Re: [Python-Dev] Doubt about closure/function generation in bytecode

2013年7月14日 23:09:06 -0700

2013年7月12日 Andrea Griffini <[email protected]>:
> Is there any semantic difference between
>
> BUILD_TUPLE 0
> LOAD_CONST <code object ... >
> MAKE_CLOSURE 0
>
> and
>
> LOAD_CONST <code object ...>
> MAKE_FUNCTION 0
>
> ?
>
> In other words is there any difference between a function and a closure that
> doesn't capture anything? Is it just a speed optimization for a common case?
It probably has more to do with the fact that nested scopes with added
much later in Python's history than functions.
>
--
Regards,
Benjamin
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to