[issue9536] defaultdict doc makes incorrect reference to __missing__ method

2010-08-06 Thread John Posner

New submission from John Posner :

The documentation for collections.defaultdict is confusing with respect to the 
__missing__ method. The fact is that a programmer using defaultdict does not 
need to know anything about __missing__.

The attached patch contains a rewrite of the entire section (but not the 
"defaultdict Examples" section, which is fine.

--
assignee: d...@python
components: Documentation
files: defaultdict.patch
keywords: patch
messages: 113105
nosy: d...@python, jjposner
priority: normal
severity: normal
status: open
title: defaultdict doc makes incorrect reference to __missing__ method
versions: Python 2.7
Added file: http://bugs.python.org/file18417/defaultdict.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9536] defaultdict doc makes incorrect reference to __missing__ method

2010-08-06 Thread R. David Murray

R. David Murray  added the comment:

I believe the description of __missing__ is there for those who want to 
subclass defaultdict, but I'll let Raymond confirm.

--
nosy: +r.david.murray, rhettinger
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> pending
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9536] defaultdict doc makes incorrect reference to __missing__ method

2010-08-08 Thread John Posner

John Posner  added the comment:

I think it would be confusing to create of subclass of defaultdict, defining a 
__missing__ method in that subclass. The existence of the __missing__ method 
would cancel the main functionality of the defaultdict object: invoking the 
"default value factory" callable.

I think it would be better to encourage programmers to subclass dict directly, 
instead of subclassing defaultdict.

--
status: pending -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9536] defaultdict doc makes incorrect reference to __missing__ method

2010-08-08 Thread John Posner

John Posner  added the comment:

On python-list, Wolfram Hinderer objected to the proposed patch's calling 
__missing__ a "special method".

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9536] defaultdict doc makes incorrect reference to __missing__ method

2010-08-08 Thread John Posner

Changes by John Posner :


--
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9536] defaultdict doc makes incorrect reference to __missing__ method

2013-01-29 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti
status: pending -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com