[issue37918] What about an enum for open() modes?

2019-08-30 Thread Marco Sulla
Marco Sulla added the comment: @vstinner Note that I wrote about os.fdopen(), not os.open(). -- ___ Python tracker ___ ___

[issue37918] What about an enum for open() modes?

2019-08-30 Thread Marco Sulla
Marco Sulla added the comment: Well, I'll discuss it in python-ideas. Let me do the testament before... :D @serhiy.storchaka thank you for the StrEnum tip, but no PyPi package please. It has no sense to add an addional package only for having an enum that should be built-in as in all other

[issue37918] What about an enum for open() modes?

2019-08-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: No modification of open() is needed. Just make your enum class a subclass of str. This idea does not look particularly attractive to me, but you can create a package on PyPi with your OpenMode class and test how popular it will be. -- nosy:

[issue37918] What about an enum for open() modes?

2019-08-30 Thread STINNER Victor
STINNER Victor added the comment: The open() function is very commonly used, so modifying it requires a lot of discussion. In Python, we prefer to discuss such changes ("feature request" if you want) on python-ideas, rather than on the bug tracker, to get more reviews and feedback. open()

[issue37918] What about an enum for open() modes?

2019-08-29 Thread Marco Sulla
Marco Sulla added the comment: Excuse me, but this is not a bug report, but a feature request. Indeed there's the possibility to submit also enhancements, not only bugs, as in all bug reporting board worthy of respect. You see the Type select with "Enhancement" option selected? --

[issue37918] What about an enum for open() modes?

2019-08-28 Thread STINNER Victor
STINNER Victor added the comment: Please send an email to the python-ideas mailing list, rather than opening a bug report at bugs.python.org. -- nosy: +vstinner resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python

[issue37918] What about an enum for open() modes?

2019-08-28 Thread Marco Sulla
Marco Sulla added the comment: Mh. No one is interested? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37918] What about an enum for open() modes?

2019-08-22 Thread Brett Cannon
Change by Brett Cannon : -- priority: normal -> low type: -> enhancement ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue37918] What about an enum for open() modes?

2019-08-22 Thread Marco Sulla
New submission from Marco Sulla : As title. I just created it: https://pastebin.com/pNYezw2V I think it could be useful to have a more descriptive way to declare a file open mode. Many languages has an enum for this. Maybe open(), os.fdopen(), os.popen() and pathlib.Path.open() can just