>
>
> |defsingle(i): try: ||v =i.next() 
> |||exceptStopIteration:||||raiseException('No
> values')|||try: ||i.next() ||exceptStopIteration: ||returnv||else:
> ||raiseException('Too many values')|
> ||printsingle(name forname in('bob','fred')ifname=='bob')||| |
>
>
​Now that looks seriously weird. Oh wait, I know, it must be a regular
expression! Perhaps mixed with Perl? To figure out what it does, we could
try compiling it and throwing input at it, or perhaps more simply by just
reverse engineering the implementation.

––Koos​
​​

-- 
+ Koos Zevenhoven + http://twitter.com/k7hoven +
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to