[Python-ideas] Re: inline Python functions and methods

2021-12-10 Thread TobiasHT
So I went back and revised my idea for inline functions in python, and I realized that it would be harder to implement them in python the way I had originally thought about them, due to Python’s dynamic nature. However, the idea itself doesn’t seem so original, as Cinder already implements

[Python-ideas] Re: inline Python functions and methods

2021-12-08 Thread TobiasHT
> What inlining usually means is to copy the body of the function > in place of the call, with appropriate parameter substitutions. > That would eliminate most of the overhead of a function call, but > there are problems with doing it in Python. Imported modules would > have to be located and

[Python-ideas] Re: inline Python functions and methods

2021-12-08 Thread TobiasHT
So for the point of benchmarks, This is a link to some of the hacks developed by Pythonistas to boost some python speed. Among the hacks, there's a topics called "reducing dots" and "local variables". https://wiki.python.org/moin/PythonSpeed/PerformanceTips Also I would explain to a pythonista

[Python-ideas] inline Python functions and methods

2021-12-07 Thread TobiasHT
The Python community has a 5 year plan to push the limit of speed in Python. One of the things that reduces Python execution speed is calling methods or functions that are not in the nearest scope. My suggestion is to introduce inline functions just as they are in C. They can be defined as

[Python-ideas] Official means to release the GIL in Python

2021-12-03 Thread TobiasHT
The GIL has been a widely discussed topic in the Python community. It's has it's advantages and disadvantages. I was suggesting that an official way be placed in the Python threading module to release the GIL if one needs to perform some tasks that don't need the GIL. It could be something as

[Python-ideas] Re: Enhancing iterator objects with map, filter, reduce methods

2021-12-01 Thread TobiasHT
Matt D wrote: > In your comprehension example, I'm fairly certain the filtering should be on > the post incremented remainder > [ x+1 for x in [1,2,3] if (x+1) % 2 == 0] how about [ sum for num in [1,2,3] if ((sum := num + 1) %2 == 0] ___ Python-ideas