Impossible to change methods with special names of instances of new-style classes?

samwyse samwyse at gmail.com
Wed Jul 9 13:51:15 EDT 2008


On Jul 8, 4:56 pm, Joseph Barillari <pyt... at barillari.org> wrote:

> My question is: did something about the way the special method names are
> implemented change for new-style classes?

Just off the top of my head, I'd guess that it's due to classes
already having a default __call__ method, used when you instatiate.
Remember, the Python compiler doesn't know the difference between
this:
  a = MyClass
  instance = a()
and this:
  a = myFunc
  result = a()



More information about the Python-list mailing list