Message166526
| Author |
sbt |
| Recipients |
alexandre.vassalotti, belopolsky, bpb, brett.cannon, ehuss, facundobatista, fmitha, georg.brandl, gvanrossum, jafo, jaraco, jarpa, kylev, loewis, lukasz.langa, nnorwitz, pitrou, sbt, taleinat, tseaver, vstinner, zbysz, zseil |
| Date |
2012年07月26日.23:16:38 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1343344599.32.0.530948449101.issue1692335@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I realize now that the idea of using object.__reduce__(..., 2) would not really work since many exception classes use non-slot descriptors (unless '__slots__' attributes were also added as hints of what to serialize).
I think there are two options simple enough to sneak in to 3.3:
(1) The trivial patch of initially setting self->args in __new__().
(2) Georg's idea of additionally setting a __newargs__ attribute in __new__() and using it in __reduce__(). However, I would store __newargs__ directly in the struct to avoid always triggering creation of a dict for the instance. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年07月26日 23:16:39 | sbt | set | recipients:
+ sbt, gvanrossum, loewis, nnorwitz, brett.cannon, georg.brandl, facundobatista, jafo, ehuss, tseaver, jaraco, belopolsky, zseil, fmitha, pitrou, vstinner, taleinat, alexandre.vassalotti, jarpa, bpb, zbysz, kylev, lukasz.langa |
| 2012年07月26日 23:16:39 | sbt | set | messageid: <1343344599.32.0.530948449101.issue1692335@psf.upfronthosting.co.za> |
| 2012年07月26日 23:16:38 | sbt | link | issue1692335 messages |
| 2012年07月26日 23:16:38 | sbt | create |
|