Sep 20, 2017

[python] Functions defined in C (builtins) have auto handled self argument.

e.g:
pow()

i.e

class X:
    mypow = pow

print(X().mypow(3, 4))
above works.

Reference:
Why does `class X: mypow = pow` work? What about `self`?
leetcode pow()

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.