[Python-ideas] Documenting Python warts

Antoine Pitrou solipsis at pitrou.net
Wed Jan 2 14:47:16 CET 2013


Le Wed, 02 Jan 2013 20:31:54 +1100,
Steven D'Aprano <steve at pearwood.info> a
écrit :
> >>>
> >>>     I.e., users have to understand the current implementation.
> >>> Mutable defaults are not a language design choice, they are
> >>> dictated by the implementation, right?
> >>
> >> No, they're not an implementation accident, they're part of the
> >> language design. It's OK if you don't like them, but please stop
> >> claiming they're a CPython implementation artifact.
> >
> > Let's call them a compromise then, but calling them a language
> > feature sounds delusional. I can't remember ever taking advantage
> > of the fact that mutable default arguments are shared accross
> > function invocations.
> 
> I've never taken advantage of multiprocessing. Does that mean that it
> is "delusional" to call multiprocessing a feature?

multiprocessing fills a definite use case (and quite an important one).
Early binding of function arguments fills no use case that cannot also
be filled using a private global, a closure, or a class or function
attribute; at best it only saves one or two lines of typing.

Regards

Antoine.





More information about the Python-ideas mailing list