Comment on Python classes aren’t always the best solutionparentComments−JohnKemeny1ynamedtuple is not a replacement for a class, but for a tuple. It is a tuple with named accessors.You can also argue that you don't need a Pair type since you can simple make a class for the two things you want to contain.
Comments
namedtuple is not a replacement for a class, but for a tuple. It is a tuple with named accessors.
You can also argue that you don't need a Pair type since you can simple make a class for the two things you want to contain.