...

/

Name Resolution Ignoring Class Scope

Name Resolution Ignoring Class Scope

We'll cover the following...

Look at the following code examples related to class scope:

1.

Can you predict the output of the following code?

Press + to interact
x = 5
class SomeClass:
x = 17
y = (x for i in range(10))
print(list(SomeClass.y)[0])

2.

Let’s modify ...