Relevance of typename in namedtuple

namedtuple() is a factory function for tuple subclasses. Here, ‘whatsmypurpose’is the type name. When you create a named tuple, a class with this name (whatsmypurpose) gets created internally. You can notice this by using the verbose argument like: Point=namedtuple(‘whatsmypurpose’,[‘x’,’y’], verbose=True) Also you can try type(p) to verify this.

C++ template typename iterator

In list<tNode<T>*>::iterator, you have a dependant name, that is, a name that depends on a template parameter. As such, the compiler can’t inspect list<tNode<T>*> (it doesn’t have its definition at this point) and so it doesn’t know whether list<tNode<T>*>::iterator is either a static field or a type. In such a situation, the compiler assumes that …

Read more