Re: [Python-Dev] Python Language Reference has no mention of list comÃprehensions

2015-12-04 Thread Eric Fahlgren
David R. Murray wrote: > I think the intuitive notion of "literal" is "the value is literally what is > written > here". Which is a redundant statement; 'as written' is, after all, what > literally > means when used correctly :). That makes it a language-agnostic concept if > I'm > correct.

Re: [Python-Dev] Python Language Reference has no mention of list comÃprehensions

2015-12-04 Thread Andrew Barnert via Python-Dev
On Dec 4, 2015, at 00:38, Nick Coghlan wrote: > > On 4 December 2015 at 12:48, Andrew Barnert via Python-Dev > wrote: >> On Dec 3, 2015, at 17:25, Steven D'Aprano wrote: On Thu, Dec 03, 2015 at 09:25:53AM -0800, Andrew Barnert via Python-Dev wrote: I've seen people saying that b

Re: [Python-Dev] Python Language Reference has no mention of list comÃprehensions

2015-12-04 Thread R. David Murray
On Fri, 04 Dec 2015 18:38:03 +1000, Nick Coghlan wrote: > Summarising that idea: > > * literals: any of the dedicated expressions that produce an instance > of a builtin type > * constant literal: literals that produce a constant object that can > be cached in the bytecode > * dynamic literal: li

Re: [Python-Dev] Python Language Reference has no mention of list comÃprehensions

2015-12-04 Thread Nick Coghlan
On 4 December 2015 at 12:48, Andrew Barnert via Python-Dev wrote: > On Dec 3, 2015, at 17:25, Steven D'Aprano wrote: >> On Thu, Dec 03, 2015 at 09:25:53AM -0800, Andrew Barnert via Python-Dev >> wrote: >>> I've seen people saying that before, but I don't know where they get >>> that. It's certai

Re: [Python-Dev] Python Language Reference has no mention of list comÃprehensions

2015-12-03 Thread Andrew Barnert via Python-Dev
On Dec 3, 2015, at 17:25, Steven D'Aprano wrote: > > On Thu, Dec 03, 2015 at 09:25:53AM -0800, Andrew Barnert via Python-Dev wrote: >>> On Dec 3, 2015, at 08:15, MRAB wrote: >>> > On 2015-12-03 15:09, Random832 wrote: > On 2015-12-03, Laura Creighton wrote: > Who came up with the w

Re: [Python-Dev] Python Language Reference has no mention of list comÃprehensions

2015-12-03 Thread MRAB
On 2015-12-04 01:56, Chris Angelico wrote: On Fri, Dec 4, 2015 at 12:25 PM, Steven D'Aprano wrote: I don't see any good reason for maintaining that there's just one syntax, "display", which comes in two forms: a comma-separated set of values, or a for-loop. The only thing they have in common (s

Re: [Python-Dev] Python Language Reference has no mention of list comÃprehensions

2015-12-03 Thread MRAB
On 2015-12-04 01:25, Steven D'Aprano wrote: On Thu, Dec 03, 2015 at 09:25:53AM -0800, Andrew Barnert via Python-Dev wrote: > On Dec 3, 2015, at 08:15, MRAB wrote: > >>> On 2015-12-03 15:09, Random832 wrote: >>> On 2015-12-03, Laura Creighton wrote: >>> Who came up with the word 'display' and w

Re: [Python-Dev] Python Language Reference has no mention of list comÃprehensions

2015-12-03 Thread Glenn Linderman
On 12/3/2015 5:56 PM, Chris Angelico wrote: You come across something syntactic that begins by opening a square bracket, and you know that its semantics are: "construct a new list". That's what's common here. What goes*inside* those brackets can be one of two things: 1) A (possibly empty) comm

Re: [Python-Dev] Python Language Reference has no mention of list comÃprehensions

2015-12-03 Thread M.-A. Lemburg
On 03.12.2015 19:27, Laura Creighton wrote: > So how do we get search to work so that people in the Language > Reference who type in 'List Comprehension' get a hit? It seems that the search index is broken for at least a few documentation file releases: ok: https://docs.python.org/2.6/search.htm

Re: [Python-Dev] Python Language Reference has no mention of list comÃprehensions

2015-12-03 Thread Laura Creighton
So how do we get search to work so that people in the Language Reference who type in 'List Comprehension' get a hit? Laura ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.p

Re: [Python-Dev] Python Language Reference has no mention of list comÃprehensions

2015-12-03 Thread Stephen J. Turnbull
Laura Creighton writes: > Am I missing something important about the 'display' language? A display is a constructor that looks like a literal but isn't. It is syntactically like the printed output, but may contain expressions to be evaluated at runtime as well as compile-time constant expressio

Re: [Python-Dev] Python Language Reference has no mention of list comÃprehensions

2015-12-03 Thread M.-A. Lemburg
On 03.12.2015 18:30, Laura Creighton wrote: > What I would like is if it were a lot easier for a person who just > saw a list comprehension for the very first time, and was told what it > is, to have a much, much easier time finding it in the Reference Manual. Such a person should more likely be d

Re: [Python-Dev] Python Language Reference has no mention of list comÃprehensions

2015-12-03 Thread Laura Creighton
What I would like is if it were a lot easier for a person who just saw a list comprehension for the very first time, and was told what it is, to have a much, much easier time finding it in the Reference Manual. Would a section on comprehensions in general, defining what a comprehension is be appro

Re: [Python-Dev] Python Language Reference has no mention of list comÃprehensions

2015-12-03 Thread Guido van Rossum
I borrowed 'display' from the formal definition of ABC. It's still used in the quick reference: http://homepages.cwi.nl/~steven/abc/qr.html#EXPRESSIONS . I hadn't heard it before and didn't think to research its heritage. I like it for list/set/dict displays since it's rather a stretch to call thos

Re: [Python-Dev] Python Language Reference has no mention of list comÃprehensions

2015-12-03 Thread Paul Moore
On 3 December 2015 at 14:26, Laura Creighton wrote: > Am I missing something important about the 'display' language? It's a term that's used in the lisp and/or functional programming communities, I believe. And I think I recollect that something similar is used in (mathematical) set theory So it'

Re: [Python-Dev] Python Language Reference has no mention of list comÃprehensions

2015-12-03 Thread M.-A. Lemburg
On 03.12.2015 17:09, Ryan Gonzalez wrote: > > > On December 3, 2015 8:26:23 AM CST, Laura Creighton wrote: >> In a message of Thu, 03 Dec 2015 13:37:17 +, Paul Moore writes: >>> On 3 December 2015 at 12:51, Laura Creighton wrote: Intentional or Oversight? >>> >>> Hard to find :-) >>> >

Re: [Python-Dev] Python Language Reference has no mention of list comÃprehensions

2015-12-03 Thread Ryan Gonzalez
On December 3, 2015 8:26:23 AM CST, Laura Creighton wrote: >In a message of Thu, 03 Dec 2015 13:37:17 +, Paul Moore writes: >>On 3 December 2015 at 12:51, Laura Creighton wrote: >>> Intentional or Oversight? >> >>Hard to find :-) >> >>https://docs.python.org/3/reference/expressions.html#dis