Callable assertion?

E

Erik Max Francis

Gonçalo Rodrigues said:
Definitely yes. There are a few strange objects that are callable and
do not have a __call__.

I wouldn't call class objects all that strange :).
 
G

Gonçalo Rodrigues

I wouldn't call class objects all that strange :).

Classic classes, yes. I started using Python at 2.2 and *never* have
used classic classes, so yes, they are like those distant, eccentric
and embarassing uncles whose only useful purpose in life seems to be
to disparage the uncomfortable silence in some boring family
get-togethers by recalling some odd anecdote or other of his misspent
life.

With my best regards,
G. Rodrigues
 
G

Greg Ewing (using news.cis.dfn.de)

Erik said:
I wouldn't call class objects all that strange :).

It is strange behaviour, though, considering
.... pass
....['__delattr__', '__setattr__', '__repr__', '__call__', '__str__',
'__getattribute__', '__new__']

so according to C's type, it *should* have a __call__ method.
I'm not sure exactly what's going on here.
 
A

Alex Martelli

_CLASSIC_ classes are very strange indeed, for backwards compat.

It is strange behaviour, though, considering
... pass
...['__delattr__', '__setattr__', '__repr__', '__call__', '__str__',
'__getattribute__', '__new__']

so according to C's type, it *should* have a __call__ method.
I'm not sure exactly what's going on here.

BW compat -- type(C) (i.e <type 'classobj'>) is the weirdest
little beast in Pythonland.

Use newstyle classes only and keep your sanity...:


Alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,166
Messages
2,570,902
Members
47,442
Latest member
KevinLocki

Latest Threads

Top