On 3/14/2011 9:23 PM, Eric Smith wrote:
On 3/14/2011 8:44 PM, James Mills wrote:
On Tue, Mar 15, 2011 at 9:48 AM, R. David
Murray<rdmur...@bitdance.com> wrote:
But directly calling a __xxx__ method in Python is a very
unusual thing to do. It would be extremely odd to have that
be the expected way to call a method on a class.

Can't namedtuple be improved to support the named fields _and_
have as_dict() and replace() without leading underscores ?

How would that work if you had a field named "replace"? I think
Raymond's current design is as good as it's going to get.

'as_dict' is an unlikely fieldname. 're_place' is too, but that just shift the '_' from '_replace'. No gain. I might prefer _asdict to _as_dict, but not enough to change.

--
Terry Jan Reedy

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to