Re: [Python-Dev] PEP 455: TransformDict

2013年9月14日 12:13:56 -0700

On 2013年9月14日 22:07:50 +0300
Serhiy Storchaka <[email protected]> wrote:
> 14.09.13 20:41, Antoine Pitrou написав(ла):
> > On 2013年9月14日 09:43:13 -0700
> > Ethan Furman <[email protected]> wrote:
> >> Still, I think it would be useful to expose the transform function.
> >> Any good reason not to?
> >
> > No good reason. What's the name? transform_func?
> 
> There is one reason -- serialization. For example pickle saves the 
> transform function as an argument for TransformDict constructor. Repr 
> exposes the transform function too (in evaluable representation). Other 
> serializers need the transform function too. My implementations expose 
> it as public property (transform), your -- as private attribute 
> (_transform).
> 
> Or perhaps I misunderstood you?
"No good reason" not to expose it. It was a double negation, sorry ;-)
Regards
Antoine.
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to