Trees

Chris Angelico rosuav at gmail.com
Wed Jan 21 13:35:46 CET 2015


On Wed, Jan 21, 2015 at 11:09 PM, Rustom Mody <rustompmody at gmail.com> wrote:
> I would like a set to be {1,2,3} or at worst ⦃1,2,3⦄
> and a bag to be ⟅1,2,3⟆
>
> Apart from the unicode niceness that Ive described here
> http://blog.languager.org/2014/04/unicoded-python.html
>
> Its a bit of a nuisance that we have to write set([1,2,3]) for the first

Wait, what?

rosuav at sikorsky:~$ python
Python 2.7.3 (default, Mar 13 2014, 11:03:55)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> type({1,2,3})
<type 'set'>
>>>
rosuav at sikorsky:~$ python3
Python 3.5.0a0 (default:4709290253e3, Jan 20 2015, 21:48:07)
[GCC 4.7.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> type({1,2,3})
<class 'set'>
>>>

Looks like {1,2,3} works for me.

ChrisA



More information about the Python-list mailing list