As known,
{} # Represents a dict
and
{'one': 1} # Again a dict
How and why is this set:
{'one', 'two', 'three', 'four'} # I thought it should give syntax error
But he gives:
set(['one', 'two', 'three', 'four']) # Strange ?? [ Should this happen ? ]
Can you provide a link to some white paper discussing the same thing?
A set of literals is a 3.x function that was inverted in 2.7.
This is a useful feature - note that concepts are also allowed.
Source: https://habr.com/ru/post/1438375/More articles:Is there a way to apply a decorator to a Python method that needs class information? - pythonEmacs 24 Ubuntu Menu Bar - emacsHow to put condition in exec in build.xml file? - parametersHow to set the "Multimedia link" field using the main service? - tridionTypeScript: access class in global module / namespace - typescriptHow to use phone plugins in our Android project - androidPHP - reading data from a magnetic card - phpNinject - constrained generic type binding - c #How to create a global type of Oracle and use it in PL / SQL? - oracleRefresh entire wicket page - refreshAll Articles