Created
August 19, 2016 09:14
-
-
Save Tinche/a50f38192325c6103673c6dbecb4c39f to your computer and use it in GitHub Desktop.
This file contains 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
_setattr_cached = object.__setattr__ | |
class A: | |
__slots__ = ('x', 'y', 'z', 'a', 'b', 'c') | |
def __init__(self, x, y, z, a, b, c): | |
_setattr = _setattr_cached.__get__(self, A) | |
_setattr('x', x) | |
_setattr('y', y) | |
_setattr('z', z) | |
_setattr('a', a) | |
_setattr('b', b) | |
_setattr('c', c) | |
def __setattr__(self, name, value): | |
raise AttributeError |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment