Message377969
> Adding a function to recalculate will require everyone to use it
I'd argue that this is akin to `functools.update_wrapper`. It too is a function that must be called in virtually every function decorator (the only function decorators that don't/needn't call it are the built-in method decorators and, appropriately enough, @abstractmethod), and if not called, certain functionality won't work.
> and worse, know that it even exists
I think that knowing about such a function is a fair requirement. Mixin tools already has nuances and edge cases, such that it should only be done (and especially distributed) by advanced users.
Furthermore, not all class mixin tools have/need to be ABC-aware. Just as `total_ordering` is ABC-agnostic (indeed, it is also subclass-agnostic), any other mixin tool can decide that implementing abstract classes is simply not a use case for them. The upshot of the `update_abstractmethods` implementation is that, as long as their implementation isn't afraid to override methods that are already defined (like attrs does), the function can be slotted above ABC-agnostic wrappers and it suddenly becomes ABC-aware. |
|
Date |
User |
Action |
Args |
2020-10-04 18:22:04 | avrahami.ben | set | recipients:
+ avrahami.ben, gvanrossum, rhettinger, eric.smith, python-dev, bar.harel |
2020-10-04 18:22:03 | avrahami.ben | set | messageid: <1601835723.97.0.696067886646.issue41905@roundup.psfhosted.org> |
2020-10-04 18:22:03 | avrahami.ben | link | issue41905 messages |
2020-10-04 18:22:03 | avrahami.ben | create | |
|