n is a object,what means: s='n' ?

Alex Martelli aleax at aleax.it
Fri Aug 31 05:48:30 EDT 2001


"Formalin" <formalin14 at email.com.cn> wrote in message
news:9mnd72$i8$1 at mail.cn99.com...
> class now:
>     ....
>     ....
>     ....
> n=now()
> s='n'
> print s
>
>
> the result:<__main__.now instance at 00B2EB0C>
>
> what means?????

You probably used reverse quotes:
    s = `n`
rather than plain quotes:
    s = 'n'

Reverse-quotes are an operator, which is equivalent to
the repr() built-in function: they return a string
representation of the object to which they're applied.


Alex






More information about the Python-list mailing list