Instance variables are typically defined in __init__(), but they can be
added to an object anywhere. The only exception is when defining the
magic __slots__ class variable to pre-define what the allowed instance
variables can be.

class A:
  pass

a = A()
a.instVar1 = "hoo-ah"
a.instVar2 = "another"

Try that in C++ or Java!

-- Paul

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to