14 ms·
>Neat, but can I add few methods to my Entry touple? Yes, if you subclass it. > Can something else inherit from Entry? Yes, it can be subclassed. >Won't nam
by task_queue 11y ago
>Neat, but can I add few methods to my Entry touple?
Yes, if you subclass it.
> Can something else inherit from Entry?
Yes, it can be subclassed.
>Won't named touple have some of its own methods that my methods could have collided with
Yes and no, it has the "index" and "count" methods any tuple should have, which can easily be overridden by specifying them as attributes in the second argument to the contructor, through reassignment during initialization or method overriding.