New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add doc-string to UserDict and DictMixin #46425
Comments
Attached patch improves pydoc UserDict presentation. One of the problems with the current documentation in comments is that If this patch is accepted in principle, the original level comments |
Fixed an error in lavels doc. Needs review. |
I'm not sure the class docstring approach is suitable for a mixin. It FWIW, all of this code goes away in Py3.0. |
On Mon, Mar 24, 2008 at 4:53 AM, Raymond Hettinger
My main point was not that some commentary was stripped by The beginning of pydoc UserDict.DictMixin is rendered as follows: UserDict.DictMixin = class DictMixin
| Methods defined here:
|
| __cmp__(self, other)
|
| __contains__(self, key)
|
| __iter__(self)
| # second level definitions support higher levels
|
| __len__(self)
.. What does "second level definitions support higher levels" comment Furthemore, pydoc UserDict is rendered as follows: NAME FILE CLASSES
... Which is not helpful at all in understanding of what DictMixin is for.
I assume you refer to UserDict as the "client class". In what sense .. that's why I selected version 2.6 when I submitted this issue. :-) However, AFAICT, not all this code goes away, just UserDict is class X(UserDict):
def __getitem__(self, _):
return 42 print(X(a=1).pop('a')) This change should probably be reflected in the docs |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: