[Python-ideas] Proposal for special name and qualname symbols

Pavol Lisy pavol.lisy at gmail.com
Mon Jun 13 12:24:47 EDT 2016


2016-06-13 12:40 GMT+02:00, Eric V. Smith <eric at trueblade.com>:
> On 6/13/2016 5:25 AM, Barry Warsaw wrote:
>> On Jun 11, 2016, at 05:00 PM, Barry Scott wrote:
>>
>>> What is the behavour in this case:
>>>
>>>   mydict[ index ] = Record( __LHS__ )
>>
>> That's a good question.  How insane/useless would it be to return in this
>> case
>> the string "mydict[ index ]"?

Or f"mydict[ {index} ]" ?

>
> Very insane, and very useless!
>
> Preserving the whitespace would be hard, and of dubious value.
>
> I suggest that if we do this, we limit it to a single identifier on the
> lhs. In the unlikely event that we need it later, we can relax the
> restriction.
>
> Eric.

I am telling nothing about usability, but relaxing later could be more
difficult due to backward compatibility!

What about:

  object.attribute = Record( __LHS__ )

?


More information about the Python-ideas mailing list