[Python-ideas] Optional static typing -- the crossroads

Łukasz Langa lukasz at langa.pl
Fri Aug 15 21:14:33 CEST 2014


On Aug 15, 2014, at 12:06 PM, Ethan Furman <ethan at stoneleaf.us> wrote:

> On 08/15/2014 11:56 AM, Ryan Hiebert wrote:
>> 
>> Getting an item from a class has no meaning for any classes that I’ve ever used, and I haven’t come up with any hypothetical one that would want to do that.
> 
> --> class Foo(Enum):
> ...    spam = 'meat flavored'
> ...    eggs = 'chicken by-product'
> ...
> --> Foo
> <enum 'Foo'>
> 
> --> Foo['spam']
> <Foo.spam: 'meat flavored’>

I also thought of enums. Looks fairly innocent to me, though. Do you see any cases where the two would conflict?

-- 
Best regards,
Łukasz Langa

WWW: http://lukasz.langa.pl/
Twitter: @llanga
IRC: ambv on #python-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140815/348e68bc/attachment.html>


More information about the Python-ideas mailing list