[PySide] pickling enums (again)

Hugo Parente Lima hugo.lima at openbossa.org
Fri Apr 26 18:50:57 CEST 2013


On Friday, April 26, 2013 11:46:12 AM John Ehresman wrote:
> On 4/26/13 11:41 AM, Hugo Parente Lima wrote:
> > I still object to "cast any integer to an enum", you could argue
> > that this isn't pythonic due to the strong type check, however this
> > would imply into a possible segmentation fault on C++ side which I
> > would say isn't pythonic either.
> 
> How would converting integers into enums after checking that they were
> valid cause a segfault?

After checking they are valid wont cause any problems, but checking if they 
are valid on every function call seems like a unnecessary overhead IMO, 
although I don't have numbers to prove this possible overhead :-)

My point is about not doing the check plus converting every integer with a 
reinterpret_cast.

> Thanks,
> 
> John
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20130426/3f75492a/attachment.sig>


More information about the PySide mailing list