micropython

tests/class_attr_ref_to_class.py

525:deb3720de7d1
2012-06-05 Paul Boddie Introduced more rigid selection of suitable types depending on whether all attributes given as being used can be found in one or more types, or whether the selection of less satisfactory types (supporting any of the attributes) is necessary.
     1 #!/usr/bin/env python     2      3 class A:     4     pass     5      6 class B:     7     x = A     8      9 class C:    10     x = A    11     12 class D:    13     x = type    14     15 result_3 = C.x is A and 3 or 0    16 result_4 = D.x is type and 4 or 0    17     18 # vim: tabstop=4 expandtab shiftwidth=4