[issue19032] __reduce_ex__ on lock object

2013-09-18 Thread Raymond Hettinger

Raymond Hettinger added the comment:

This does not look like a bug to me.
I think this should be closed.

--
nosy: +rhettinger

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



[issue19032] __reduce_ex__ on lock object

2013-09-18 Thread Ram Rachum

Changes by Ram Rachum r...@rachum.com:


--
status: open - closed

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



[issue19032] __reduce_ex__ on lock object

2013-09-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I don't really know. It simply looks like the default implementation of 
__reduce_ex__. Is it important?

--
nosy: +pitrou

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



[issue19032] __reduce_ex__ on lock object

2013-09-16 Thread Ram Rachum

Ram Rachum added the comment:

I use that to test whether an object is pickleable or not. It used to work in 
Python 2.

--

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



[issue19032] __reduce_ex__ on lock object

2013-09-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 I use that to test whether an object is pickleable or not. It used to
 work in Python 2.

Well, the obvious way to do it would be to call pickle.dumps() on
the object, IMO :-)

--

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



[issue19032] __reduce_ex__ on lock object

2013-09-16 Thread Ram Rachum

Ram Rachum added the comment:

Wrong, because the object itself could be pickleable but refer to a different 
object which is non-pickleable. I want to know whether the object itself, 
without any object it refers to, is pickleable.

Also, pickling an object could be very resource-intensive, depending on its 
size.

--

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



[issue19032] __reduce_ex__ on lock object

2013-09-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 Wrong, because the object itself could be pickleable but refer to a
 different object which is non-pickleable. I want to know whether the
 object itself, without any object it refers to, is pickleable.

I think you're being too picky. Unless you're manually added stuff
to your Lock's attributes, there isn't a practical difference between
the two situations.

 Also, pickling an object could be very resource-intensive, depending
 on its size.

Well, this is a Lock here, not an ISO file.

--

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



[issue19032] __reduce_ex__ on lock object

2013-09-15 Thread Ram Rachum

New submission from Ram Rachum:

 import threading
 l = threading.Lock()
 l.__reduce_ex__(3)
(function __newobj__ at 0x026CD8C8,
 (class '_thread.lock',),
 None,
 None,
 None)

Isn't it a bug that `__reduce_ex__` works on the non-pickleable lock object?

--
components: Library (Lib)
messages: 197850
nosy: cool-RR
priority: normal
severity: normal
status: open
title: __reduce_ex__ on lock object
type: behavior
versions: Python 3.3

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