What for -- for? (was A bug?)

Rustom Mody rustompmody at gmail.com
Wed Oct 29 00:40:16 EDT 2014


On Wednesday, October 29, 2014 9:53:46 AM UTC+5:30, Zachary Ware wrote:
> On Tue, Oct 28, 2014 at 11:16 PM, Zachary Ware wrote:
> > def get_abc_map(cls):
> >    return {n: issubclass(cls, getattr(abc, n)) for n in dir(abc) if
> > n[0].isupper()}
> 
> Of course, Gmail decided to wrap my long line for me.  In case it's
> not obvious, that should be a single line.

Thanks

Wrapping -- no problem.
But the isupper looks like black-magic :-)

And removing the ' ... if n[0].isupper()'
breaks the code



More information about the Python-list mailing list