diff --git a/docs/source/traits_api_reference/trait_types.rst b/docs/source/traits_api_reference/trait_types.rst index 5b057ab0d..ac73a2b5c 100644 --- a/docs/source/traits_api_reference/trait_types.rst +++ b/docs/source/traits_api_reference/trait_types.rst @@ -99,8 +99,6 @@ Traits .. autoclass:: Method -.. autoclass:: Class - .. autoclass:: Module .. autoclass:: Python @@ -202,10 +200,6 @@ Traits .. autodata:: ListMethod -.. autodata:: ListClass - -.. autodata:: ListInstance - .. autodata:: ListThis .. autodata:: DictStrAny diff --git a/docs/source/traits_user_manual/defining.rst b/docs/source/traits_user_manual/defining.rst index 6453f621a..e2894e290 100644 --- a/docs/source/traits_user_manual/defining.rst +++ b/docs/source/traits_user_manual/defining.rst @@ -234,7 +234,7 @@ casting traits:: Other Predefined Traits ``````````````````````` The Traits package provides a number of other predefined traits besides those -for simple types, corresponding to other commonly used data types; these +for simple types, corresponding to other commonly used data types; ::these predefined traits are listed in the following table. Refer to the *Traits API Reference*, in the section for the module traits.traits, for details. Most can be used either as simple names, which use their built-in @@ -242,7 +242,7 @@ default values, or as callables, which can take additional arguments. If the trait cannot be used as a simple name, it is omitted from the Name column of the table. -.. index:: Any(), Array(), Button(), Callable(), CArray(), Class(), Code() +.. index:: Any(), Array(), Button(), Callable(), CArray(), Code() .. index:: Color(), CSet(), Constant(), Dict() .. index:: Directory(), Disallow, Either(), Enum() .. index:: Event(), Expression(), false, File(), Font() @@ -277,8 +277,6 @@ the table. | CArray | CArray( [*dtype* = None, *shape* = None, *value* = None, | | | *typecode* = None, \*\*\ *metadata*] ) | +------------------+----------------------------------------------------------+ -| Class | Class( [*value*, \*\*\ *metadata*] ) | -+------------------+----------------------------------------------------------+ | Code | Code( [*value* = '', *minlen* = 0, *maxlen* = sys.maxint,| | | *regex* = '', \*\*\ *metadata*] ) | +------------------+----------------------------------------------------------+ @@ -332,11 +330,9 @@ the table. | | *module* = None, \*\*\ *metadata*] ) | +------------------+----------------------------------------------------------+ | List, ListBool, | List([*trait* = None, *value* = None, *minlen* = 0, | -| ListClass, | *maxlen* = sys.maxint, *items* = True, \*\*\ *metadata*])| | ListComplex, | | | ListFloat, | | | ListFunction, | | -| ListInstance, | | | ListInt, | | | ListMethod, | | | ListStr, | | diff --git a/traits/api.py b/traits/api.py index d71cc2671..e55aa8526 100644 --- a/traits/api.py +++ b/traits/api.py @@ -133,14 +133,6 @@ DictStrList, ) -try: - from .trait_types import Class, ListClass, ListInstance -except ImportError: - # Python 3 does not have old-style classes anymore, so Class does not exist - # interestingly, ListInstance is not equivalent to List(Instance), but - # rather only allows old-style instances. - pass - from .trait_types import ( BaseInt, BaseLong, diff --git a/traits/trait_types.py b/traits/trait_types.py index 9af10b50c..f4b4784a1 100644 --- a/traits/trait_types.py +++ b/traits/trait_types.py @@ -1210,20 +1210,6 @@ class Method(TraitType): info_text = "a method" -if six.PY2: - from types import ClassType - - class Class(TraitType): - """ Defines a trait whose value must be an old-style Python class. - """ - - #: The C-level fast validator to use: - fast_validate = (11, ClassType) - - #: A description of the type of value this trait accepts: - info_text = "an old-style class" - - class Module(TraitType): """ Defines a trait whose value must be a Python module. """ @@ -3857,15 +3843,6 @@ def resolve_class(self, object, name, value): #: List of method values; default value is []. ListMethod = List(MethodType) -if six.PY2: - from types import ClassType, InstanceType - - #: List of class values; default value is []. - ListClass = List(ClassType) - - #: List of instance values; default value is []. - ListInstance = List(InstanceType) - #: List of container type values; default value is []. ListThis = List(ThisClass)