[issue27635] pickle documentation says that unpickling may not call __new__

2020-10-11 Thread Alexandre Vassalotti


Change by Alexandre Vassalotti :


--
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue27635] pickle documentation says that unpickling may not call __new__

2020-10-11 Thread Irit Katriel


Irit Katriel  added the comment:

Ping (to close the issue).

--
nosy: +iritkatriel

___
Python tracker 

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



[issue27635] pickle documentation says that unpickling may not call __new__

2020-04-21 Thread Furkan Onder


Furkan Onder  added the comment:

The problem is fixed, issue can be closed.

--

___
Python tracker 

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



[issue27635] pickle documentation says that unpickling may not call __new__

2020-04-18 Thread miss-islington


miss-islington  added the comment:


New changeset 020f2aaaea95aef6f54ab31488926ed76017e41a by Miss Islington (bot) 
in branch '3.8':
bpo-27635: Fix pickle documentation about `__new__` not being called. (GH-19269)
https://github.com/python/cpython/commit/020f2aaaea95aef6f54ab31488926ed76017e41a


--

___
Python tracker 

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



[issue27635] pickle documentation says that unpickling may not call __new__

2020-04-18 Thread miss-islington


miss-islington  added the comment:


New changeset 0abb548cc7b239fbe426ca9e00968130e53ffc98 by Miss Islington (bot) 
in branch '3.7':
bpo-27635: Fix pickle documentation about `__new__` not being called. (GH-19269)
https://github.com/python/cpython/commit/0abb548cc7b239fbe426ca9e00968130e53ffc98


--

___
Python tracker 

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



[issue27635] pickle documentation says that unpickling may not call __new__

2020-04-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18923
pull_request: https://github.com/python/cpython/pull/19586

___
Python tracker 

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



[issue27635] pickle documentation says that unpickling may not call __new__

2020-04-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18922
pull_request: https://github.com/python/cpython/pull/19585

___
Python tracker 

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



[issue27635] pickle documentation says that unpickling may not call __new__

2020-04-18 Thread miss-islington

miss-islington  added the comment:


New changeset 482259d0dcf27714a84cf56b93977320bea7e093 by Furkan Önder in 
branch 'master':
bpo-27635: Fix pickle documentation about `__new__` not being called. (GH-19269)
https://github.com/python/cpython/commit/482259d0dcf27714a84cf56b93977320bea7e093


--
nosy: +miss-islington

___
Python tracker 

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



[issue27635] pickle documentation says that unpickling may not call __new__

2020-03-31 Thread Furkan Onder


Furkan Onder  added the comment:

There is still an mistake in the document. I sent a pr to fix it.

--

___
Python tracker 

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



[issue27635] pickle documentation says that unpickling may not call __new__

2020-03-31 Thread Furkan Onder


Change by Furkan Onder :


--
keywords: +patch
nosy: +furkanonder
nosy_count: 4.0 -> 5.0
pull_requests: +18626
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/19269

___
Python tracker 

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



[issue27635] pickle documentation says that unpickling may not call __new__

2017-02-18 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +alexandre.vassalotti, serhiy.storchaka
stage:  -> needs patch
type:  -> behavior
versions: +Python 3.7 -Python 3.4

___
Python tracker 

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



[issue27635] pickle documentation says that unpickling may not call __new__

2016-07-27 Thread July Tikhonov

New submission from July Tikhonov:

A note just below object.__setstate__() documentation
https://docs.python.org/3.6/library/pickle.html#object.__setstate__
says that
"""
… the type should implement __getnewargs__() or __getnewargs_ex__() to 
establish such an invariant; otherwise, neither __new__() nor __init__() will 
be called.
"""

I believe that note about not calling __new__() was relevant in python2. I 
could not find case in python3 in which __new__() would not be called. And 
__init__() is not called anyway, as far as I understand (unless explicitly by 
__setstate__() or something).

Python 3.6.0a3+ (default:da9898e7e90d, Jul 27 2016, 19:51:12) 
[GCC 4.9.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> class C:
...   def __getstate__(self): return {'foo' : self.foo}
...   def __setstate__(self, state): self.foo = state['foo']
...   def __new__(cls):
... print('__new__ is called'); return super().__new__(cls)
...   def __init__(self):
... print('__init__ is called'); self.foo = None; super().__init__()
... 
>>> c = C(); c.foo = 'bar'
__new__ is called
__init__ is called
>>> import pickle
>>> c2 = pickle.loads(pickle.dumps(c))
__new__ is called
>>> c2.foo
'bar'

--
assignee: docs@python
components: Documentation
messages: 271465
nosy: docs@python, july
priority: normal
severity: normal
status: open
title: pickle documentation says that unpickling may not call __new__
versions: Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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