New submission from Peter Otten:

The documentation for 

copyreg.pickle(type, function, constructor=None)

has the sentence

"TypeError will be raised if *object* is a class or *constructor* is not 
callable."

It's not clear to me what "object" refers to. I believe it refers to the first 
arg (called ob_type in 2.x) and classic classes which were handled with

def pickle(ob_type, pickle_function, constructor_ob=None):
    if type(ob_type) is _ClassType:
        raise TypeError("copy_reg is not intended for use with classes")

in 2.x If I'm right the above sentence should become.

"A TypeError will be raised if *constructor* is not callable."

in 3.x. If I'm wrong please think of way to express the intended meaning more 
clearly.

Another minor change: class C need not inherit from object explicitly in  3.x.

----------
assignee: docs@python
components: Documentation
messages: 212541
nosy: docs@python, peter.otten
priority: normal
severity: normal
status: open
title: Clarify copyreg.pickle() documentation
versions: Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20823>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to