array of objects

a_olme at hotmail.com a_olme at hotmail.com
Sun Dec 31 11:30:31 CET 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