Python traitlets.TraitType() Examples

The following are 6 code examples of traitlets.TraitType(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module traitlets , or try the search function .
Example #1
Source File: autodoc_traits.py    From kubespawner with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def can_document_member(cls, member, membername, isattr, parent):
        return isinstance(member, TraitType) 
Example #2
Source File: util.py    From pySINDy with MIT License 5 votes vote down vote up
def __new__(mcls, name, bases, classdict):
        # FIXME: this duplicates the code from MetaHasTraits.
        # I don't think a super() call will help me here.
        for k,v in iteritems(classdict):
            if isinstance(v, TraitType):
                v.name = k
            elif inspect.isclass(v):
                if issubclass(v, TraitType):
                    vinst = v()
                    vinst.name = k
                    classdict[k] = vinst
        cls = MetaQObject.__new__(mcls, name, bases, classdict)
        return cls 
Example #3
Source File: autodoc_traits.py    From binderhub with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def can_document_member(cls, member, membername, isattr, parent):
        return isinstance(member, TraitType) 
Example #4
Source File: autodoc_traitlets.py    From dask-gateway with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def can_document_member(cls, member, membername, isattr, parent):
        return isinstance(member, TraitType) 
Example #5
Source File: util.py    From qtconsole with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def __new__(mcls, name, bases, classdict):
        # FIXME: this duplicates the code from MetaHasTraits.
        # I don't think a super() call will help me here.
        for k,v in iteritems(classdict):
            if isinstance(v, TraitType):
                v.name = k
            elif inspect.isclass(v):
                if issubclass(v, TraitType):
                    vinst = v()
                    vinst.name = k
                    classdict[k] = vinst
        cls = MetaQObject.__new__(mcls, name, bases, classdict)
        return cls 
Example #6
Source File: util.py    From Carnets with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def __new__(mcls, name, bases, classdict):
        # FIXME: this duplicates the code from MetaHasTraits.
        # I don't think a super() call will help me here.
        for k,v in iteritems(classdict):
            if isinstance(v, TraitType):
                v.name = k
            elif inspect.isclass(v):
                if issubclass(v, TraitType):
                    vinst = v()
                    vinst.name = k
                    classdict[k] = vinst
        cls = MetaQObject.__new__(mcls, name, bases, classdict)
        return cls