[Python-ideas] functools.partial

Yury Selivanov yselivanov.ml at gmail.com
Fri Jun 8 04:57:29 CEST 2012


Hello,
While I was working on adding support for 'functools.partial' in PEP 362, 
I discovered that it doesn't do any sanity check on passed arguments
upon creation.
Example:
 def foo(a):
 pass
 p = partial(foo, 1, 2, 3) # this line will execute
 p() # this line will fail
Is it a bug? Or is it a feature, because we deliberately don't do any checks 
because of performance issues? If the latter - I think it should be at least 
documented.
-
Yury


More information about the Python-ideas mailing list

AltStyle によって変換されたページ (->オリジナル) /