Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add wat: print not equal to lambda x: print(x) #42

Open
zzh1996 opened this issue Feb 26, 2019 · 1 comment
Open

add wat: print not equal to lambda x: print(x) #42

zzh1996 opened this issue Feb 26, 2019 · 1 comment

Comments

@zzh1996
Copy link

zzh1996 commented Feb 26, 2019

>>> class A:
...  pass
... 
>>> a = A()
>>> A.f = print
>>> a.f()

>>> A.f = lambda x: print(x)
>>> a.f()
<__main__.A object at 0x1023739b0>
@tgandor
Copy link

tgandor commented Aug 27, 2019

Oh yes?

Try A.f() instead of a.f() - I don't think it's really a WAT.

And when writing A.f = print differently, you should write A.f = lambda *args, **kwargs: print(*args, **kwargs) anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants