Is this type of forward referencing possible?
Lawrence D'Oliveiro
ldo at geek-central.gen.new_zealand
Sun Mar 15 03:54:34 EDT 2009
In message <a96e95ab-9953-4e61-
ad66-09759aa1c1f5 at e1g2000pra.googlegroups.com>, Kooks are people too wrote:
> If I try this:
>
> class A:
> someType = B
>
> class B:
> anotherType = A
>
> I get:
> <type 'exceptions.NameError'>: name 'B' is not defined
> args = ("name 'B' is not defined",)
> message = "name 'B' is not defined"
Try
class A:
pass
class B:
anotherType = A
A.someType = B
More information about the Python-list
mailing list