Behavior of the for-else construct

Peter J. Holzer hjp-python at hjp.at
Fri Mar 4 17:57:46 EST 2022


On 2022-03-04 00:38:22 +0000, Avi Gross via Python-list wrote:
> I have seen major struggles to get other character sets into
> languages. Any new language typically should have this built in from
> scratch and should consider adding non-ASCII characters into the mix.
> Mathematicians often use lots of weird braces/brackets as an example
> while normal programs are limited to [{( and maybe < and their
> counterparts. This leads to odd Python behavior (other languages too)
> where symbols are re-used ad nauseam. { can mean set or dictionary or
> simply some other way to group code.

I think the main reason for this is that people have to be able to type
the code. I do remember the days when German keyboards didn't have
brackets and braces and you had to type alt-123 to get a {. Made it real
fun to program in C ...

If you design a language and in IDE together (the way Smalltalk was
designed back in the 1970s or maybe Visual Basic) you can use all sorts
of funky characters because you can also provide a standard way to enter
them. But if you expect your users to type programs in a standard text
editor (even a fancy one like Emacs or Vim or VS Code), you have to
restrict yourself to a character set that most people can comfortably
type on their keyboards with the key mapping provided by their OS. Which
for historical reasons means US-ASCII.

        hp

-- 
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp at hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://mail.python.org/pipermail/python-list/attachments/20220304/11ace58f/attachment.sig>


More information about the Python-list mailing list