[issue4121] open(): use keyword only for arguments other than file and mode

2009-03-19 Thread STINNER Victor
STINNER Victor added the comment: Guido> Beyond 3.0, I'm still rather reluctant Ok ok, let's close this bad idea. -- resolution: -> rejected status: open -> closed ___ Python tracker _

[issue4121] open(): use keyword only for arguments other than file and mode

2008-10-14 Thread Guido van Rossum
Guido van Rossum <[EMAIL PROTECTED]> added the comment: This is certainly out of scope for 3.0. Remember, for 3.0 we're trying to get a release out of the door, not cram in new features, no matter how small. Beyond 3.0, I'm still rather reluctant -- I expect most users will be wise and use keyw

[issue4121] open(): use keyword only for arguments other than file and mode

2008-10-14 Thread STINNER Victor
STINNER Victor <[EMAIL PROTECTED]> added the comment: > Do you suggest that 'buffering' should be allowed > as positional argument? No, I would prefer to keep also two positional arguments: file and mode. I hate open(filename, 'r', s): I don't know what is s, the buffering or the encoding? An

[issue4121] open(): use keyword only for arguments other than file and mode

2008-10-14 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: Do you suggest that 'buffering' should be allowed as positional argument? This would help with migration from 2.x, where open() accepts 3 positional arguments: open(...) open(name[, mode[, buffering]]) -> file object And no need

[issue4121] open(): use keyword only for arguments other than file and mode

2008-10-14 Thread STINNER Victor
STINNER Victor <[EMAIL PROTECTED]> added the comment: socket.makefile() already uses keyword only argument, but buffering is not a keyword only argument: def makefile(self, mode="r", buffering=None, *, encoding=None, newline=None): ___ Py

[issue4121] open(): use keyword only for arguments other than file and mode

2008-10-14 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: It's true that the order of arguments is difficult to remember correctly. However I think this deserves Guido's approval. About the implementation: To build the kw dict, did you consider using Py_BuildValue? Something like: kw = Py_B

[issue4121] open(): use keyword only for arguments other than file and mode

2008-10-14 Thread STINNER Victor
Changes by STINNER Victor <[EMAIL PROTECTED]>: Added file: http://bugs.python.org/file11785/explicit_open-fixtests.patch ___ Python tracker <[EMAIL PROTECTED]> ___

[issue4121] open(): use keyword only for arguments other than file and mode

2008-10-14 Thread STINNER Victor
New submission from STINNER Victor <[EMAIL PROTECTED]>: In the C library, fopen() have two arguments: filename and the mode, and open() has three arguments: filename, mode and flags. In Python, open() has 7 arguments: - file - mode - buffering - encoding - errors - newline - closefd Mos