smarie/python-autoclass

Support `pyfields` as an alternate way to define attributes

smarie opened this issue · 0 comments

As of today, all decorators provided in autoclass source their initial attribute list on the constructor (__init__) signature.

Alternately one could wish to define the fields using pyfields:

  • @autodict and @autohash would work independently
  • @autoclass would also work: it would apply only @autodict and @autohash (and not @autoargs nor @autoprops as they are not anymore relevant in this context)
from autoclass import autoclass
from pyfields import field

@autoclass
class A(object):
    a = field()