mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 20:20:14 +01:00
tests/basics: Add test for assignment of attribute to bound method.
This commit is contained in:
@@ -22,3 +22,9 @@ print(m(1))
|
|||||||
# bound method with lots of extra args
|
# bound method with lots of extra args
|
||||||
m = A().h
|
m = A().h
|
||||||
print(m(1, 2, 3, 4, 5, 6))
|
print(m(1, 2, 3, 4, 5, 6))
|
||||||
|
|
||||||
|
# can't assign attributes to a bound method
|
||||||
|
try:
|
||||||
|
A().f.x = 1
|
||||||
|
except AttributeError:
|
||||||
|
print('AttributeError')
|
||||||
|
|||||||
Reference in New Issue
Block a user