Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What about slots ? #9

Closed
smarie opened this issue Sep 13, 2017 · 1 comment
Closed

What about slots ? #9

smarie opened this issue Sep 13, 2017 · 1 comment

Comments

@smarie
Copy link
Owner

smarie commented Sep 13, 2017

No description provided.

@smarie
Copy link
Owner Author

smarie commented Oct 21, 2019

As of today, autoclass works with slotted classes but you need to declare the slots explicitly:

@autoclass
class Foo(object):
    __slots__ = ('_foo1', '_foo2')

    def __init__(self, foo1, foo2=0):
        pass

Since @autoclass decorator is applied after the class has been created, the only way for us transform it automatically to a slot-ed class would be to generate a new type.

@smarie smarie closed this as completed in 074d9d5 Oct 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant