[Python-Dev] [Python-checkins] r53110 - python/trunk/Lib/mailbox.py (original) (raw)
Guido van Rossum guido at python.org
Fri Dec 29 22:55:43 CET 2006
- Previous message: [Python-Dev] [Python-checkins] r53110 - python/trunk/Lib/mailbox.py
- Next message: [Python-Dev] [Python-checkins] r53110 - python/trunk/Lib/mailbox.py
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 12/29/06, "Martin v. Löwis" <martin at v.loewis.de> wrote:
Fred L. Drake, Jr. schrieb: > Speaking strictly for myself: I don't think I have to use them, but I do > prefer to use them because I don't like magic constants that affect what a > function does in code; I'd rather have a named constant for readability's > sake. Maybe I just can't keep enough in my head, but I don't find I actually > use seek() enough to remember what the numeric values mean with checking the > reference documentation.
But you can remember the symbolic names (plus you can remember what module they are in, in what Python version)? I'd have to consult the documentation for either; help(file.seek) gives the numeric values.
I'm with Martin here.
But my main objection to suggesting that these constants ought to be used is that open() is a built-in but you would have to import os to be able to call the seek method on the object it returns.
If we want to make the seek API more 21st century, why not use keyword arguments?
-- --Guido van Rossum (home page: http://www.python.org/~guido/)
- Previous message: [Python-Dev] [Python-checkins] r53110 - python/trunk/Lib/mailbox.py
- Next message: [Python-Dev] [Python-checkins] r53110 - python/trunk/Lib/mailbox.py
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]