> On Feb 23, 2011, at 5:42 AM, Nick Coghlan wrote:
>
>> Ah, how (much more) confused would we be if we didn't have the PEPs
>> and mailing list archives to remind ourselves of what we were thinking
>> years ago...
>>
> True. And how much more useful it would be if it were incorporated into
> the do
Eric Smith wrote:
On 2/22/2011 6:28 PM, Steve Holden wrote:
On Feb 22, 2011, at 3:08 PM, Eric Smith wrote:
Quoting PEP 3101:
An example of the 'getitem' syntax:
"My name is {0[name]}".format(dict(name='Fred'))
It should be noted that the use of 'getitem' within a format string
is muc
On Feb 23, 2011, at 5:42 AM, Nick Coghlan wrote:
> Ah, how (much more) confused would we be if we didn't have the PEPs
> and mailing list archives to remind ourselves of what we were thinking
> years ago...
>
True. And how much more useful it would be if it were incorporated into the
documentati
On 02/23/2011 09:42 AM, R. David Murray wrote:
On Tue, 22 Feb 2011 19:32:56 -0500, Eric Smith wrote:
You are correct, I didn't exactly implement the PEP on this point,
probably as a shortcut. I think there's an issue somewhere that
discusses this, but I can't find it. The CPython implementation
On Tue, 22 Feb 2011 19:32:56 -0500, Eric Smith wrote:
> You are correct, I didn't exactly implement the PEP on this point,
> probably as a shortcut. I think there's an issue somewhere that
> discusses this, but I can't find it. The CPython implementation is
> really using "If every character is
On Wed, Feb 23, 2011 at 9:32 AM, Senthil Kumaran wrote:
> """
> Because keys are not quote-delimited, it is not possible to
> specify arbitrary dictionary keys (e.g., the strings "10" or
> ":-]") from within a format string.
> """
I was curious as to whether or not nested substitution could
On 02/22/2011 07:32 PM, Eric Smith wrote:
On 2/22/2011 6:28 PM, Steve Holden wrote:
On Feb 22, 2011, at 3:08 PM, Eric Smith wrote:
Quoting PEP 3101:
An example of the 'getitem' syntax:
"My name is {0[name]}".format(dict(name='Fred'))
It should be noted that the use of 'getitem' within a fo
On 2/22/2011 6:28 PM, Steve Holden wrote:
On Feb 22, 2011, at 3:08 PM, Eric Smith wrote:
Quoting PEP 3101:
An example of the 'getitem' syntax:
"My name is {0[name]}".format(dict(name='Fred'))
It should be noted that the use of 'getitem' within a format string
is much more limited th
On 2/22/2011 6:32 PM, Senthil Kumaran wrote:
On Tue, Feb 22, 2011 at 6:01 PM, Steve Holden wrote:
... It would appear from tests
that "{0[X]}".format(...) first tries to convert the string "X" to in
integer. If it succeeds then __getitem__() is called with the integer as an
argument, otherwise
> On Tue, Feb 22, 2011 at 6:01 PM, Steve Holden wrote:
>> ... It would appear from tests
>> that "{0[X]}".format(...) first tries to convert the string "X" to in
>> integer. If it succeeds then __getitem__() is called with the integer as an
>> argument, otherwise it is called with the string itsel
On Feb 22, 2011, at 3:08 PM, Eric Smith wrote:
> Quoting PEP 3101:
>
> An example of the 'getitem' syntax:
>
>"My name is {0[name]}".format(dict(name='Fred'))
>
> It should be noted that the use of 'getitem' within a format string
> is much more limited than its conventional usage. In
Quoting PEP 3101:
An example of the 'getitem' syntax:
"My name is {0[name]}".format(dict(name='Fred'))
It should be noted that the use of 'getitem' within a format string
is much more limited than its conventional usage. In the above example,
the string 'name' really is the literal str
On Tue, Feb 22, 2011 at 6:01 PM, Steve Holden wrote:
> ... It would appear from tests
> that "{0[X]}".format(...) first tries to convert the string "X" to in
> integer. If it succeeds then __getitem__() is called with the integer as an
> argument, otherwise it is called with the string itself as a
13 matches
Mail list logo