Pierre-Yves Bourguignon

Results 6 comments of Pierre-Yves Bourguignon

I just came across this discussion while at a loss trying to figure out a right way to use attrs in a non-attrs hierarchy. I think that the following simple...

Thanks for the prompt reply, this is bringing me much further already. Much appreciated! This solution has one drawback however: it makes me repeat myself. Each attribute is now listed...

I think there is a possibility to keep it stupid simple by generally changing the attrs-generated `__init__` as follows: ```python def __init__(self, attr1, attr2, *args, **kwargs): ...do what it already...

As for your question: > would it be feasible to just notice extra arguments in the signature for `__attrs_post_init__` I'd say inspect has all you need for that.

>> On the other hand, the solution you suggest has the added benefit of __init__ signature being complete. > I think that's pretty important for typing. Yes, it is, and...

@sinback Sorry, no, not yet. I settled on a custom __init__ solution for my current needs.