我们从Python开源项目中,提取了以下2个代码示例,用于说明如何使用traitlets.TraitType()。
def can_document_member(cls, member, membername, isattr, parent): return isinstance(member, TraitType)
def _get_additional_traits(cls): try: default = cls._additional_traits[0] except TypeError: default = cls._additional_traits if isinstance(default, T.TraitType): return default elif default: return T.Any() else: return None