Python design failures (was Re: Let's Talk About Lambda Functions!)

Aahz aahz at pythoncraft.com
Mon Jul 29 15:31:13 EDT 2002


In article <3d457011_1 at news.newsgroups.com>, JB  <jb at hotmail.com> wrote:
>Aahz wrote:
>> 
>> If you're using backticks frequently, you're probably not programming
>> Pythonically.  There's already repr() to produce the same result as
>> backticks, and backticks have the problem that in many fonts they're
>> nearly indistinguishable from single quotes.
>
>I do not understand this. I use __repr__ *and* backticks. 
>For example
>
>class AnyClass:
>  defr __repr__(self):
>    ...
>
>a = AnyClass()
>myfile.write(`a`)

You should use

myfile.write(repr(a))

It's much clearer that you're *NOT* doing

myfile.write('a')

Yes, the Python std lib has backticks in it.  Cleaning that up would
likely be the first step toward deprecating backticks.  In any event,
backticks will certainly be available at least until Python 3.0.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

Project Vote Smart: http://www.vote-smart.org/



More information about the Python-list mailing list