micropython

Annotated tests/classes.py

36:5d8f34d7ce7f
2008-02-06 Paul Boddie Changed namespaces to return Attr objects and the visitor to pass around such objects for use with base class resolution and attribute access. Namespaces still accept "bare" objects, not Attr objects. Removed the Self class, adding a name attribute to Attr objects to compensate. Moved assignment tracking into the Attr objects so that there is a possibility of certain characteristics of names being checked during module inspection; for example, base classes can be checked to see if they are sufficiently constant. Fixed locals, all_locals results in the Function class.
paul@36 1
#!/usr/bin/env python
paul@36 2
paul@36 3
class A:
paul@36 4
    pass
paul@36 5
paul@36 6
class B:
paul@36 7
    pass
paul@36 8
paul@36 9
for x in A, B:
paul@36 10
    class C(x):
paul@36 11
        pass
paul@36 12
paul@36 13
# vim: tabstop=4 expandtab shiftwidth=4