Reducing Python's startup time
I have grown to seriously dislike 'namedtuple'. It seems great, and it's so easy to use, but there's so few places it can be used without dragging in future backwards-compatibility baggage.Let's say you have a light-weight object, like a "full name" which can be represented with a "forename" and an "surname". (Yes, there are many names which don't fit this category. This is a toy example.) So you write:  from collections import namedtuple
  FullName = namedtuple("FullName", "forename surname")
  name = FullName("Edward", "Smith")

So simple! So clean! No "self.forename = forename" or need to make your own __repr__.Except you also inherit the tuple behavior, because this isn't really light-weight object but a ... let's call it a heavy-weight tuple.  >>> name[0]
  'Edward'
  >>> name[1]
  'Smith'

This mean people may (okay, are likely) do things like:  forename, surname = name

or even  for forename, surname in names:
    ...

Even if that's not what you want in your API. If you care about backwards compatibility, then if you replace the namedtuple with its own class then you'll have to re-implement __getitem__, _replace, __len__, and count - methods which make no sense for a simple name class.Or, if you decided to change the API, to make it be:  FullName = namedtuple("FullName", "forename middlename surname suffix")

then you'll again break code which used the full indexing API that you originally implicitly promised, simply by saying this is a namedtuple.'namedtuple' has one good use - migration from a tuple object to a real object while allowing backwards compatability to the tuple API.  For example, the old tuples once returned from os.stat() and time.gmtime().It's also fine if it will only be used by code where you have full control over its use and can either prevent inappropriate API use like destructuring assignment, or can update all uses if you want to change the API. For example, a light-weight object used in a test-suite or internal helper function.Otherwise, don't use it. Spend the extra few minutes so in the future you don't have to worry about backwards compatibility issues.