In Python 3, set-notation more closely matches the way sets are represented in set-theory while Python 2 uses a list style (i.e. set_py3 = {"A","B","C"}
\ set_py2 = set(["A","B","C"])
)
Is there any way to port the set-notation from Python 3 to Python 2 using from __future__
?
Py2.7 let's one use the {"A","B","C"}
set-notation but when it's printed, it is still set(["A","B","C"])
. I saw the from __future__ import braces
but I don't think that introduces this type of set-notation. I know you can import the new print function with from __future__ import print_function
. I wasn't sure if there was a similar method for porting set-notation.