Last active
November 20, 2023 23:22
-
-
Save jepler/1c912dadff47ff94709479d757e616b7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class N(NativeBaseClass): | |
@property | |
def subtest(self): | |
return super().test | |
@subtest.setter | |
def subtest(self, value): | |
# BUG: In this context something prevents the compiler from | |
# transforming the super() call to the 2-arg version | |
# which results in | |
# "TypeError: function takes 2 positional arguments but 0 were given" | |
super().test = value | |
# This alternative gets further along (allows triggering AttributeError | |
# incorrectly instead): | |
super(N, self).test = value | |
n = N() | |
n.test = 7 | |
print(n.test) | |
print(n.subtest) # BUG: segfaults on this line | |
# BUG: AttributeError: can't set attribute 'test' | |
n.subtest = 8 | |
print(n.test) | |
print(n.subtest) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment