On 2018-04-15 13:31, Kirill Balunov wrote:
>
>
> 2018-04-15 10:58 GMT+03:00 Yubin Ruan :
>
> [this is a bit late...]
>
> Did you really have any benchmark for it? I know what you are doing but it
> seems to be a pre-mature optimization. If this really is the
On Tue, Mar 6, 2018 at 8:02 PM, Kirill Balunov wrote:
>
>
> 2018-03-05 17:34 GMT+03:00 Chris Angelico :
>>
>> In theory, the CPython bytecode compiler (don't know about other
>> Python implementations) could just add these as constants. They'd then
>> be
2018-03-05 21:44 GMT+03:00 Terry Reedy :
> Yes, what we really want for this sort of thing are unrebindable local
> constants. A simple syntax change could do it.
>
> def func_local_1(numb; int = int, float = float, range = range):
>
> The binding after ';' belong in the
On 03/05/2018 07:44 PM, Terry Reedy wrote:
On 3/5/2018 9:34 AM, Chris Angelico wrote:
On Tue, Mar 6, 2018 at 12:52 AM, Terry Reedy wrote:
On 3/5/2018 7:12 AM, Kirill Balunov wrote:
# 1. By passing through local variable's default values
def func_local_1(numb, _int =
2018-03-05 17:34 GMT+03:00 Chris Angelico :
> In theory, the CPython bytecode compiler (don't know about other
> Python implementations) could just add these as constants. They'd then
> be bound at either compile time or function definition time (by
> default the former, I
On 3/5/2018 9:34 AM, Chris Angelico wrote:
On Tue, Mar 6, 2018 at 12:52 AM, Terry Reedy wrote:
On 3/5/2018 7:12 AM, Kirill Balunov wrote:
# 1. By passing through local variable's default values
def func_local_1(numb, _int = int, _float = float, _range = range):
You
On Tue, Mar 6, 2018 at 12:52 AM, Terry Reedy wrote:
> On 3/5/2018 7:12 AM, Kirill Balunov wrote:
>> # 1. By passing through local variable's default values
>>
>> def func_local_1(numb, _int = int, _float = float, _range = range):
>
>
> You are not required to mangle the
On 3/5/2018 7:12 AM, Kirill Balunov wrote:
Hi,
At the moment, in order to slightly speed up the function in Python, free
variables are passed as local variables to the function, thereby getting
rid of extra look ups. For example, for the following function, I
especially do not use list
Hi,
At the moment, in order to slightly speed up the function in Python, free
variables are passed as local variables to the function, thereby getting
rid of extra look ups. For example, for the following function, I
especially do not use list comprehension) and therefore maybe it's not the
best