[Tutor] backquotes and str() are not exactly equivalent
Danny Yoo
dyoo@hkn.eecs.berkeley.edu
Tue, 31 Jul 2001 00:11:55 -0700 (PDT)
Hiya everyone,
I'm doing a small project with Postgresql, and as I was inserting data
into the database, I noticed that the backquote operator doesn't do
exactly what str() does. Here's an example that shows what I mean:
###
>>> myname = 'tutor-curator'
>>> str(myname)
'tutor-curator'
>>> `myname`
"'tutor-curator'"
>>> repr(myname)
"'tutor-curator'"
###
That is, backquotes (``) do a repr() of its input, and not an str() as I
had thought before. Just wanted to share my goofup with everyone else...
*grin*
I'm having quite a bit of fun with the 'pygresql' and 'mailbox' modules,
so if anyone has questions about these two modules, feel free to ask
questions.