Guido> No, I meant that "for x.a in mylist: ..." is valid but shouldn't Guido> be, Valid? I'll buy that, but it had never occurred to me. Useful? That's not immediately obvious: >>> class Foo: ... def __init__(self): ... self.a = 42 ... >>> lst = [Foo() for i in range(4)] >>> lst [<__main__.Foo instance at 0x752760>, <__main__.Foo instance at 0x7529e0>, <__main__.Foo instance at 0x752df0>, <__main__.Foo instance 0x7529e0>at 0x752dc8>] >>> [x for x.a in lst] [Type help() for interactive help, or help(object) for help about object., Type help() for interactive help, or help(object) for help about object., Type help() for interactive help, or help(object) for help about object., Type help() for interactive help, or help(object) for help about object.] Skip
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4