smarie / python-pyfields

Define fields in python classes. Easily.
https://smarie.github.io/python-pyfields
BSD 3-Clause "New" or "Revised" License
45 stars 10 forks source link

Wrong fields list when a field is overridden in a subclass #49

Closed smarie closed 4 years ago

smarie commented 4 years ago
class A(object):
    a = field(default='hello')

class B(A):
    b = field(default='world')

    def a(self):
        pass

    __init__ = make_init()

B(a='h', b='w')

yields TypeError: __init__() got an unexpected keyword argument 'a'