how to dynamically instantiate an object inheriting from several classes?

George Sakkis george.sakkis at gmail.com
Sat Nov 22 16:27:33 EST 2008


On Nov 22, 9:32 am, Joe Strout <j... at strout.net> wrote:
> On Nov 21, 2008, at 7:02 PM, Steven D'Aprano wrote:
>
> >> I have a function that takes a reference to a class,
>
> > Hmmm... how do you do that from Python code? The simplest way I can  
> > think
> > of is to extract the name of the class, and then pass the name as a
> > reference to the class, and hope it hasn't been renamed in the  
> > meantime...
>
> Please quit trying to confuse the kids at home.  Classes in Python are  
> first-class objects, and any time you refer to a class or any other  
> object in Python, what you have is a reference to it.

..which makes the phrase "a reference to an X" a more verbose,
redundant version of "an X" since it applies to *every* Python object.
You have made your point in the 300+ posts thread, so please quit the
terminology trolling in every new thread.

George



More information about the Python-list mailing list