This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steven.daprano
Recipients isaacsjohnson22, steven.daprano
Date 2022-02-16.06:42:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1644993744.72.0.119748788358.issue46766@roundup.psfhosted.org>
In-reply-to
Content
I'm sorry, I don't see why you think this will improve code readability. I also expect it will be harder to teach than the current code.

open("file.img", "wb") just needs the user to learn about reading and writing files, and the difference between binary and text files. It works the same way in probably dozens of different languages.

open("file.img", File.Write | File.Binary | File.Disk) needs the beginner to learn the same details, *plus* they have to learn about this mystery File object, classes, dot notation, `|` the bitwise-or operator, and how to import File from the io module.

My guess is that File.Write etc are just enums equivalent to strings 'w' and 'b', but what's File.Disk?

What else does this File object do?
History
Date User Action Args
2022-02-16 06:42:24steven.dapranosetrecipients: + steven.daprano, isaacsjohnson22
2022-02-16 06:42:24steven.dapranosetmessageid: <1644993744.72.0.119748788358.issue46766@roundup.psfhosted.org>
2022-02-16 06:42:24steven.dapranolinkissue46766 messages
2022-02-16 06:42:24steven.dapranocreate