[Python-ideas] Syntax for easy binding __name__, __module__, __qualname__ to arbitrary objects

Yuval Greenfield ubershmekel at gmail.com
Fri May 10 09:25:06 CEST 2013


On Fri, May 10, 2013 at 2:08 AM, Greg Ewing <greg.ewing at canterbury.ac.nz>wrote:

> Paul Moore wrote:
>
>> Overall, I'm somewhat indifferent. The use case seems fairly specialised
>> to me, and yet the syntax "def name = value" seems like it's worth
>> reserving for something a bit more generally useful.
>>
>
> Hmmm. Maybe
>
>    def name = value
>
> could turn into
>
>    name = value.__def__('name', __name__)
>
>

C-esque macros (and perhaps macropy) could implement this and decorators
under the same roof. Perhaps we can somehow solve the more general problem
without introducing macro kludge?

Yuval
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130510/ad1a97b3/attachment.html>


More information about the Python-ideas mailing list