Package org.python.core
Annotation Type Untraversable
-
@Retention(RUNTIME) @Target(TYPE) public @interface Untraversable
Indicates that a given class is not traversable and does intentionally not implementTraverseproc
. This annotation is ignored if the class implementsTraverseproc
, i.e. it cannot be used to removeTraverseproc
support of a superclass. Thus it is well defined what happens if bothTraverseproc
and{@literal @}Untraversable
are present:Traverseproc
wins.
If a class does not implementTraverseproc
and is not annotated with{@literal @}Untraversable
, gc assumes that the programmers were not aware of Jython's traverse mechanism and attempts to traverse the target object by using Java-reflection (which is assumably very inefficient).