Message212541
| Author |
peter.otten |
| Recipients |
docs@python, peter.otten |
| Date |
2014年03月02日.08:46:05 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1393749966.08.0.529137298895.issue20823@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2014年03月02日 08:46:06 | peter.otten | set | recipients:
+ peter.otten, docs@python |
| 2014年03月02日 08:46:06 | peter.otten | set | messageid: <1393749966.08.0.529137298895.issue20823@psf.upfronthosting.co.za> |
| 2014年03月02日 08:46:05 | peter.otten | link | issue20823 messages |
| 2014年03月02日 08:46:05 | peter.otten | create |
|