Classes Instances

Creating a new instance

     a = Account(1000.00)
     b = Account(500.00)

Method invocation

     a.deposit(500.00)
     a.deposit(23.45)
     a.withdraw(78.20)
     print a.getbalance()

Attribute access

     print a.balance
     a.balance = 500000.00 

Destruction

  • Objects destroyed when reference count drops to zero.
  • Usually this is automatic, but you can also do this
     del a
<<< O'Reilly OSCON 2000, Introduction to Python, Slide 93
July 17, 2000, beazley@cs.uchicago.edu
>>>