
July 24, 2017
4:02 a.m.
On 07/23/2017 10:47 AM, Michel Desmoulin wrote:
I'm not sure why everybody have such a grip on the type.
If I understand the goal of "a new namedtuple" correctly, it is not to come up with yet another namedtuple type -- it is to make the existing collections.namedtuple a faster experience, and possibly add another way to create such a thing. This means that the "replacement" namedtuple MUST be backwards compatible with the existing collections.namedtuple, and keeping track of type is one of the things it does: --> from collections import namedtuple --> Point = namedtuple('Point', 'x y') --> p1 = Point(3, 7) --> p1.x 3 --> p1.y 7 --> isinstance(p1, Point) True -- ~Ethan~
2795
Age (days ago)
2795
Last active (days ago)
0 comments
1 participants
participants (1)
-
Ethan Furman