Yongzhi Pan added the comment:
I think metal means that the different ways set is repr'd in 2.7 and 3.
In 2.7:
In [9]: a = {x for x in 'abracadabra' if x not in 'abc'}
In [10]: repr(a)
Out[10]: set(['r', 'd'])
In 3.2:
In [6]: a = {x for x in 'abracadabra' if x not in 'abc'}
In [7]: repr(a)
Yongzhi Pan added the comment:
Great they are backported to 2.7. Dictionary and set comprehensions are not
documented in the tutorial of 2.7, though they are in the language reference.
Is it OK to add these to the tutorial? I've uploaded a patch.
--
nosy: +fossilet
Added file:
Ezio Melotti added the comment:
Is it OK to add these to the tutorial? I've uploaded a patch.
Yes, but please create a new issue.
How about fixing set.__repr__ ?
Is it broken?
--
___
Python tracker rep...@bugs.python.org
METAL XXX metal...@gmail.com added the comment:
How about fixing set.__repr__ ?
--
nosy: +metal
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2333
___
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +ezio.melotti
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2333
___
___
Python-bugs-list
Alexandre Vassalotti alexan...@peadrop.com added the comment:
Committed in r77422.
--
resolution: - accepted
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2333
Alexandre Vassalotti alexan...@peadrop.com added the comment:
If there are no objections, I will commit this patch later this week
after issue #2335.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2333
Mark Dickinson dicki...@gmail.com added the comment:
Alexandre, I can't get this to apply cleanly to my svn trunk checkout
(r74328) (see attached log). Am I doing something stupid?
--
nosy: +marketdickinson
Added file: http://bugs.python.org/file14670/patch_failure.log
Mark Dickinson dicki...@gmail.com added the comment:
Ah, that works. Thanks! (I'll pay more attention to the tracker
Dependencies field in future.)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2333
Alexandre Vassalotti alexan...@peadrop.com added the comment:
You need to apply the set literal patch I posted in issue2335 first.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2333
___
Alexandre Vassalotti alexan...@peadrop.com added the comment:
Here is a patch to backport dict and set comprehensions to the trunk.
The patch preserves the Python 3.x's syntax and semantics of the
feature. Although this makes dict and set comprehensions is inconsistent
with list comprehension,
Changes by Alexandre Vassalotti alexan...@peadrop.com:
--
dependencies: +Backport set literals
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2333
___
12 matches
Mail list logo