[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 pairs)

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

However, it doesn't feel right to not be able to initialize an empty set as 
cleanly and consistently as lists, tuples and dictionaries in both forms.
___
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.org/message/3VPVY2BUHAULUBBQD3UKUIOPQXUZOLLP/
Code of Conduct: http://python.org/psf/codeofconduct/


[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@python.org/message/KYPH76YPDDZFZRM2XD3YWNSN2YZUYLIY/
Code of Conduct: http://python.org/psf/codeofconduct/