On 17.05.2017 23:29, Ivan Levkivskyi wrote:
On 17 May 2017 at 20:09, Sven R. Kunze <srku...@mail.de
<mailto:srku...@mail.de>> wrote:
class Foo(dictlike, tuplelike, simpleobject):
attribute1: User
attribute2: Blog
attribute3: list
def __my_dunder__(self):
...
As I understand this is more or less what is proposed,
Are you sure? Could you point me to the relevant messages where mixins
are mentioned as a key part of the proposal? All I could find are
message using the @decorator syntaxes.
We've been working with mixins successfully for years now and I can tell
you that it's "just" a clever way of refactoring existing code in order
to make it more accessible to other modules *based on use-cases*.
So, the best person to tell what pieces to factor out would be Stephan
using his 4-point list.
And of course other people using NamedTuple but frequently refactoring
to "attr" or own class because NamedTuple just is too much (defines too
much implicitly).
Another benefit is that NamedTuple itself would become a mere set of
base class and mixins.
the idea is to write it into a PEP and consider API/corner
cases/implementation/etc.
Who's writing it?
Regards,
Sven
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/