PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 265 - Value types should support copying (deep and shallow)
: Value types should support copying (deep and shallow)
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: Shiboken
: HEAD
: All All
: P5 normal
Assigned To: Marcelo Lira
:
: 266
:
  Show dependency treegraph
 
Reported: 2010-07-15 09:45 EEST by Lauro Moura
Modified: 2010-11-25 17:48 EET (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lauro Moura 2010-07-15 09:45:10 EEST
Sample snippet from PySide

from PySide.QtCore import QRect
from copy import copy

a = QRect(10, 10, 10, 10)
b = copy(a)

a is b # returns false
a == b # segfaults

This also breaks copy.deepcopy.
Comment 1 Lauro Moura 2010-07-20 08:39:46 EEST
Editing the summary to include deepcopy.

There's an initial support for __copy__ at [1].

For deepcopy, there are two options: provide __deepcopy__ or implement
__reduce__ to allow pickling.


[1] http://qt.gitorious.org/~lauromoura/pyside/lauro-shiboken/commits/copy
Comment 2 Lauro Moura 2010-10-05 14:46:03 EEST
Updated code:
http://qt.gitorious.org/~lauromoura/pyside/lauro-shiboken/commits/pickling

Also marking as depends on 266, as the pickling support is used by the deepcopy
module.
Comment 3 renato filho 2010-10-13 13:45:45 EEST
Fixed on shiboken commit:
commit d26ecefed858fb548d57f66028f3191b5c298453
Author: Lauro Neto <lauro.neto@openbossa.org>
Date:   Tue Jul 20 17:57:08 2010 -0300

Pyside commit:
commit 4c8660413a66b8e006687def786d9a82c6870094
Author: renatofilho <renato.filho@openbossa.org>
Date:   Wed Oct 13 12:55:41 2010 -0300
Comment 4 renato filho 2010-11-25 17:48:07 EET
released on 1.0.0~beta1