[Python-Dev] Updated PEP 362 (Function Signature Object)

Yury Selivanov yselivanov.ml at gmail.com
Wed Jun 6 16:04:50 CEST 2012


On 2012-06-06, at 9:28 AM, Isaac Morland wrote:

> On Wed, 6 Jun 2012, Nick Coghlan wrote:
> 
>> 2. Signature.bind introduces the ability to split the "bind arguments
>> to parameters" operation from the "call object" operation
> 
> Has anybody considered calling bind __call__?  That is, the result of calling the signature of a procedure instead of the procedure itself is the locals() dictionary the procedure would start with (except presumably missing non-parameter local variables).

I'd stick with more explicit 'bind' method.

Compare (given the 'sig = signature(func)'):
   
    ba = sig(*args, **kwargs)

to:
    
    ba = sig.bind(*args, **kwargs)

The second case looks more clear to me.

Thanks,
-
Yury
  


More information about the Python-Dev mailing list