On Fri, 05 Feb 2010 16:49:00 +0100, Jean-Michel Pichavant wrote:
> Anyway why would you want to use the tuple form ? it's beaten in every
> aspect by the dictionary form.
Except convenience, efficiency and readability.
"%s %s" % (1, 2)
versus
"%(a)s %(b)s" % {'a': 1, 'b': 2}
I'm all in favou
On Feb 5, 6:57 am, bradallen wrote:
> Hello,
>
> For container class derived from namedtuple, but which also behaves
> like a dictionary by implementing __getitem__ for non-integer index
> values, is there a special reserved method which allows intercepting %
> string formatting operations? I woul
On Fri, Feb 5, 2010 at 9:49 AM, Jean-Michel Pichavant
wrote:
> Anyway why would you want to use the tuple form ? it's beaten in every
> aspect by the dictionary form.
I'm subclassing a namedtuple, and adding some additional functionality
such as __getitem__, __setitem__, so that the namedtuple a
bradallen wrote:
Hello,
For container class derived from namedtuple, but which also behaves
like a dictionary by implementing __getitem__ for non-integer index
values, is there a special reserved method which allows intercepting %
string formatting operations? I would like for my container type
Hello,
For container class derived from namedtuple, but which also behaves
like a dictionary by implementing __getitem__ for non-integer index
values, is there a special reserved method which allows intercepting %
string formatting operations? I would like for my container type to
behave appropria