4 ms·
But in short: you can't require non-ascii symbols for languages which are supposed to be accessible While I agree that everything should be ASCII the Python co
by goatinaboat 7y ago
But in short: you can't require non-ascii symbols for languages which are supposed to be accessible
While I agree that everything should be ASCII the Python community believes everything should be Unicode, since Python 3.
- thayne 7y agoThere is a difference between using unicode for strings, which necessarily must support internationalization, and the syntax of the language itself
- geofft 7y ago1. ASCII is a subset of Unicode. You can be both. 2. The change in Python 3 is the introduction of a distinct string type specifically because there are things that are not Unicode, namely bytestrings. Several things that could have been implicitly Unicode in Python 2 have become not-Unicode in Python 3 (e.g., the return value of subprocess.check_output). 3. You enter bytestring literals in ASCII.
- squiggleblaz 7y agoCan you enter BEL, NUL, line feed, and " in a bytestring literal, and if so, can a person seriously say with a straight face that 0x5c 0x6e is mathematically and physically identical with 0x0a. I suppose I could believe in ascii bytestring literals if the string literal were length tagged pascal strings.
- rumanator 7y ago> 1. ASCII is a subset of Unicode. You can be both. You can encode a character, just like you can express Farsi symbols and smiley faces and other emojis, but no keyboard layout supports it. What's the point of supporting a character if no standard input device lets you type it?
- filmor 7y agoPython 3 also allows for non-ASCII identifiers.
- filmor 7y agoJust to be clear, this comment was just a clarification on what goatinaboat might have been getting at, I was in no way suggesting that the snappy claim > While I agree that everything should be ASCII the Python community believes everything should be Unicode, since Python 3. had any substance. It's just important to know IMHO that not only string handling changed in Python 3, but that you can indeed Unicode-ify your identifiers now as well to a certain extend (see https://www.python.org/dev/peps/pep-3131/ https://www.python.org/dev/peps/pep-3131/). I still don't do it for interoperability reasons.
- goatinaboat 7y agoIndeed it’s right here https://www.python.org/dev/peps/pep-3131/ https://www.python.org/dev/peps/pep-3131/ Seems a few people on this thread don’t know Python as well as they think they do
- oefrha 7y agoPlenty of mainstream languages allow non-ASCII characters in identifiers. Pretty much none of them (at least not one that I've worked with) have non-ASCII delimiters/operators/keywords/reserved words. Knowing non-ASCII characters is supported in identifiers has nothing to do with objecting to non-ASCII symbols in the language syntax. (Btw plenty of languages tell you non-ASCII characters are supported in identifier names in the first pages of official tutorials, e.g. golang and Swift off the top of my head, so knowing this kind of stuff doesn't make you a language expert.)
- goatinaboat 7y agoknowing this kind of stuff doesn't make you a language expert Never said it did. But I will say for a fact that those who don’t know it are not language experts.
- geofft 7y agoNobody in this thread disputed that Python 3 allows for non-ASCII identifiers.
- viraptor 7y agoEncoding of keywords and the default string abstract representation are entirely different things.