newbie help ?

John Hunter jdhunter at ace.bsd.uchicago.edu
Fri May 16 10:22:45 EDT 2003


>>>>> "Fredrik" == Fredrik Lundh <fredrik at pythonware.com> writes:

    Fredrik> not necessarily; the compiler doesn't really care if you
    Fredrik> make typos in the comments.

True, but many readers of posts do, and he's not submitting his post
to the compiler.  Given the number of typos, I assumed (wrongly) that
plone was also a typo.  Had the text been otherwise correct, I would
have assumed (rightly) that it was a python package I had not heard
of. 

    >> file=open("codes.txt",'r+') #open the file
    >> 
    >> Danger.  'file' is a built-in name; don't use it as a variable
    >> name.

    Fredrik> who cares?  Python doesn't, so why should you?

python also doesn't care if I use 1 space for indentation or obfuscate
my code, but most human readers would.  Pointing out style conventions
is fair game.  Even if not everyone adheres to them, I'd guess most
would advise a newbie not to clobber built-in functions with variable
names, unless they had specific reason to do so.

    >> Does r+ mean something?

    Fredrik> it means open the file for reading and truncating,
    Fredrik> without truncating it.

Did you mean 'for reading and writing'?

Cheers,
JDH






More information about the Python-list mailing list