On 3/13/2022 5:49 PM,
joao.p.f....@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 = {:} # new empty dictionary (the ":" is a reference to key-value pairs)
This is such a good idea that many people, including myself, have
already had it, and even more agree that this would be the proper way
for a new language. But as already discussed on python-ideas, this
change would break possibly millions of programs, and we will will not
do that. Please don't futilely push this further.
> Current workaround at least for consistency:
> l = list() # new empty list
> t = tuple() # new empty tuple
> s = set() # new empty set
> d = dict() # new empty dictionary
Anyone who values consistency can pay the price of this in ones own code.
If you have questions, python-list would be the appropriate place.
--
Terry Jan Reedy
Message archived at
https://mail.python.org/archives/list/pytho...@python.org/message/5XVT47A2AWGKM3BRJD27OD3I64IPEQ2N/