Skip to content

Instantly share code, notes, and snippets.

@jepler
Last active November 20, 2023 23:22
Show Gist options
  • Save jepler/1c912dadff47ff94709479d757e616b7 to your computer and use it in GitHub Desktop.
Save jepler/1c912dadff47ff94709479d757e616b7 to your computer and use it in GitHub Desktop.
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