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) comma-separated sequence of expressions > > 2) One or more nested 'for' loops, possibly guarded by 'if's, and a > single expression > > So we have two subforms of the same basic syntax. The first one > corresponds better to the output format, in the same way that a string > literal might correspond to its repr under specific circumstances. > Neither is a literal. Neither is a call to a constructor function > (contrast "list()" or "list.__new__(list)", which do call a > constructor). So what is this shared syntax? Whatever word is used, > it's going to be a bit wrong. I'd be happy with either "constructor" > or "display", myself. Construction. It includes an implicit constructor call and does more. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20151203/9ed6e566/attachment.html>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4