More comprehension issues.

This commit is contained in:
Dave Halter
2016-07-28 18:12:41 +02:00
parent 1903b31b9a
commit f605359c16
4 changed files with 37 additions and 14 deletions

View File

@@ -181,3 +181,20 @@ def x():
foo = [x for x in [1, '']][:1]
#? int()
foo[0]
# -----------------
# In class
# -----------------
class X():
def __init__(self, bar):
self.bar = bar
def foo(self):
x = [a for a in self.bar][0]
#? int()
x
return x
#? int()
X([1]).foo()