Luke Plant wrote: > Bo Yang wrote: > >> I know in java , we can use >> >> class.ForName("classname") >> >> >> to get an instance of the class 'classname' from a >> string , in python , how do I do that ? > > In Python, classes are first class objects, so normally you would pass > the class itself around, rather than use the names of classes. Of > course that might not be practical or applicable in your situation.
While JAVA is severely limited regarding the number of seats in the first class, classes _are_ sitting there. The need for dynamic attribute look up is even more frequent in python - think getattr, __getitem__, __getattr__. Diez -- http://mail.python.org/mailman/listinfo/python-list