[issue2333] Backport set and dict comprehensions

2012-11-14 Thread Yongzhi Pan

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)
Out[7]: "{'r', 'd'}"

We were saying not changing __repr__ in #2335.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2333] Backport set and dict comprehensions

2012-11-13 Thread Ezio Melotti

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2333] Backport set and dict comprehensions

2012-11-13 Thread Yongzhi Pan

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: http://bugs.python.org/file27981/set_and_dict_comprehensions.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2333] Backport set and dict comprehensions

2010-08-04 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2333] Backport set and dict comprehensions

2010-08-04 Thread METAL XXX

METAL XXX  added the comment:

How about fixing set.__repr__ ?

--
nosy: +metal

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2333] Backport set and dict comprehensions

2010-01-11 Thread Alexandre Vassalotti

Alexandre Vassalotti  added the comment:

Committed in r77422.

--
resolution:  -> accepted
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2333] Backport set and dict comprehensions

2009-12-11 Thread Alexandre Vassalotti

Alexandre Vassalotti  added the comment:

If there are no objections, I will commit this patch later this week
after issue #2335.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2333] Backport set and dict comprehensions

2009-08-06 Thread Mark Dickinson

Mark Dickinson  added the comment:

Ah, that works.  Thanks!  (I'll pay more attention to the tracker 
Dependencies field in future.)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2333] Backport set and dict comprehensions

2009-08-06 Thread Alexandre Vassalotti

Alexandre Vassalotti  added the comment:

You need to apply the set literal patch I posted in issue2335 first.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2333] Backport set and dict comprehensions

2009-08-06 Thread Mark Dickinson

Mark Dickinson  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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2333] Backport set and dict comprehensions

2009-08-05 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti :


--
dependencies: +Backport set literals

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2333] Backport set and dict comprehensions

2009-08-05 Thread Alexandre Vassalotti

Alexandre Vassalotti  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, I believe this is reasonable since the backport
aimed to improve the compatibility of Python 2.x with Python 3.x.

The patch also adds support for dict and set comprehensions to the
'compiler' package. However, the support is quirky and use the list
comprehension semantics of Python 2.x. This allowed me to keep the patch
simple and to keep myself sane ;-).

Finally, the patch changes the name of the following syntax nodes:
'gen_expr', 'gen_iter', 'gen_if', and 'testlist_gexp'. I don't know if
we have compatibility requirements for this; so I don't know if this is
an issue.

--
keywords: +patch
nosy: +alexandre.vassalotti
stage:  -> patch review
title: Backport dict comprehensions -> Backport set and dict comprehensions
Added file: 
http://bugs.python.org/file14661/backport_dict_and_set_comprehension.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com