[Python-Dev] __getattr__ and new style classes

Christian Heimes lists at cheimes.de
Thu Oct 9 00:53:06 CEST 2008


Steven D'Aprano wrote:
> Not only don't I observe the same results as you, I'm afraid I can't 
> even get your code to run. I get a SyntaxError from the funny quotes 
> you're using: ´d.foo´ instead of 'd.foo' or "d.foo".

Kristján is using the old style and alternative syntax for repr(). 
Somehow the `` got screwed up by either his mailer or the mailing list. 
Don't be ashamed that you aren't aware of the alternative syntax. We 
keep it locked up in the cellar and it has been removed from the new, 
shiny Python 3 world.

 >>> `object`
"<type 'object'>"
 >>> `object` == repr(object)
True

Christian



More information about the Python-Dev mailing list