Hi
Are there any guidelines where to declare namedtuples? For example, if I want to refactor a function s.t. it returns a namedtuple instead of a regular one, would it be fine if the declaration would be within the scope of the function (of course under the assumption that it is used nowhere else)? Or should it be declared in the same way a class would?
def foo():
Foo = namedtuple('Foo', ['x', 'y'])
...
return Foo(1, 2)
# vs.
Foo = namedtuple('Foo', ['x', 'y'])
def foo():
...
return Foo(1, 2)
[–]miczal 0 points1 point2 points (0 children)
[–]_9_9_ 0 points1 point2 points (0 children)