[issue20823] Clarify copyreg.pickle() documentation

2017-06-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could you update your patch Peter, and since CPython development is moved to 
GitHub, create a pull request?

--

___
Python tracker 

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



[issue20823] Clarify copyreg.pickle() documentation

2017-02-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The phrase "*function* should return either a string or a tuple containing two 
or three elements." de-facto is outdated too. Since Python 2.3 a tuple returned 
by the function must have two to five elements.

copyreg.constructor() no longer does anything useful, and the constructor 
parameter of copyreg.pickle() is virtually ignored.

--
nosy: +serhiy.storchaka
stage:  -> patch review
type:  -> behavior
versions: +Python 3.5, Python 3.6, Python 3.7 -Python 3.3

___
Python tracker 

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



[issue20823] Clarify copyreg.pickle() documentation

2014-03-02 Thread Peter Otten

Changes by Peter Otten <__pete...@web.de>:


--
keywords: +patch
Added file: http://bugs.python.org/file34263/copyreg.patch

___
Python tracker 

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



[issue20823] Clarify copyreg.pickle() documentation

2014-03-02 Thread Peter Otten

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 

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