array of objects

a_olme at hotmail.com a_olme at hotmail.com
Sun Dec 31 05:30:31 EST 2000


Hello!

How do I create a array of object from my own classes?

If I have a class like this:

class test:
	def dosomething(self):
		return 1234

obj= test()

obj= [test(),test()]

The last line works but is there a more elegant way?

//Anders Olme


Sent via Deja.com
http://www.deja.com/



More information about the Python-list mailing list