3 ms·
> Are you dynamically creating a named tuple (a record?) by passing a space separated list of field names? Why? Very little in python is bound statically. Thi
by wyldfire 5y ago
> Are you dynamically creating a named tuple (a record?) by passing a space separated list of field names? Why?
Very little in python is bound statically. This is akin to a type definition. The type will behave as an ordered tuple that can be indexed but also alias these attribute names to those ordinals.
assert(a == Point(a, b).x)
assert(b == Point(a, b).y)
assert(a == Point(a, b)[0])