[Python-Dev] Re: cpython: simplify and rewrite the zipimport part of 702009f3c0b1 a bit

2022-03-13 Thread Tommie Cadieux
___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.or

[Python-Dev] An unambiguous way of initializing an empty dictionary and set

2022-03-13 Thread joao . p . f . batista . 97
Currently: l = [] # new empty list t = () # new empty tuple s = set() # new empty set (no clean and consistent way of initializing regarding the others) <<< d = {} # new empty dictionary Possible solution: s = {} # new empty set d = {:} # new empty dictionary (the ":" is a reference to key-value

[Python-Dev] Re: An unambiguous way of initializing an empty dictionary and set

2022-03-13 Thread Ethan Furman
On 3/13/22 14:49, joao.p.f.batista...@gmail.com wrote: > Currently: > l = [] # new empty list > t = () # new empty tuple > s = set() # new empty set (no clean and consistent way of initializing regarding the others) <<< > d = {} # new empty dictionary > > Possible solution: > s = {} # new empty

[Python-Dev] Re: An unambiguous way of initializing an empty dictionary and set

2022-03-13 Thread joao . p . f . batista . 97
Thanks! ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@py

[Python-Dev] Re: An unambiguous way of initializing an empty dictionary and set

2022-03-13 Thread Christopher Barker
> Possible solution: > s = {} # new empty set > d = {:} # new empty dictionary (the ":" is a reference to key-value pairs) This would be fine for a new language. But completely out of the question for Python — it would break an enormous amount of code. We are in this position because sets are re

[Python-Dev] Re: An unambiguous way of initializing an empty dictionary and set

2022-03-13 Thread Christopher Barker
Oops, didn’t notice this wasn’t Python-ideas — that’s where it should be. -CHB On Sun, Mar 13, 2022 at 3:44 PM Christopher Barker wrote: > > Possible solution: >> s = {} # new empty set >> d = {:} # new empty dictionary (the ":" is a reference to key-value pairs) > > > This would be fine for a

[Python-Dev] Re: An unambiguous way of initializing an empty dictionary and set

2022-03-13 Thread Terry Reedy
On 3/13/2022 5:49 PM, joao.p.f.batista...@gmail.com wrote: Currently: l = [] # new empty list t = () # new empty tuple s = set() # new empty set (no clean and consistent way of initializing regarding the others) <<< d = {} # new empty dictionary Possible solution: s = {} # new empty set d = {:}

[Python-Dev] Re: An unambiguous way of initializing an empty dictionary and set

2022-03-13 Thread Jeremiah Vivian
> s = {} # new empty set > d = {:} # new empty dictionary (the ":" is a reference to key-value pairs) Even though this isn't python-ideas, I just want to suggest having it like this: s = {,} # new empty set d = {} # same syntax for new empty dictionary Instead of the backwards-incompatible change a