New submission from Serhiy Storchaka <storchaka+cpyt...@gmail.com>:

Currently most extension types are not pickleable and copyable. The default 
error messages is "can't pickle XXX objects". This is confusing in case of 
copying because not all know that copying falls back to the pickle protocol 
(see for example issue33023). The proposed PR changes the default error 
messages to more neutral "cannot serialize 'XXX' object". This or similar error 
messages are already used in some classes (files, sockets, 
compressors/decompressors).

It also removes __getstate__ methods raising an error from non-pickleable 
extension types. They where added when extension types were pickleable by 
default (fixed in issue22995). Now they are not needed.

----------
components: Interpreter Core
messages: 314418
nosy: alexandre.vassalotti, christian.heimes, pitrou, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Improve standard error for uncopyable types
type: enhancement
versions: Python 3.8

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

Reply via email to