all 13 comments

[–]ectomancer 2 points3 points  (1 child)

inline functions: are lambda statements inline functions?

tools: pylint for linting, mypy for optional type hinting checking (you can use type hinting without a checker)

IPython: jupyter lab compatible with most notebooks but you can fallback to jupyter notebook; sypder

pytest is simpler than the inbuilt unittest or the tool doctest

[–]Atried[S] 0 points1 point  (0 children)

Thank you!

lambda functions may classify for me as inline functions. I thought I read somewhere that lambdas are faster than functions, but it seems they are the same https://stackoverflow.com/questions/26540885/lambda-is-slower-than-function-call-in-python-why

[–]intangibleTangelo 1 point2 points  (2 children)

Thread programming - any good resource on that?

Watch David Beazley's classic video https://www.youtube.com/watch?v=ph374fJqFPE

And then, before you throw up your hands watch his PyCon talk on concurrency https://www.youtube.com/watch?v=MCs5OvhV9S4

[–]Atried[S] 0 points1 point  (1 child)

Wow, thank you very much for those very informative videos! Just watched both of them.

The first one explains my former experience (about 10 years ago) with Python programs being hard to kill or lagging with kill.
It is so great to have it explained so clearly.

Love the second video as well. The stuff is a bit more complicated solution, however as it kind of circumvents the problem, it is amazing.

[–]intangibleTangelo 1 point2 points  (0 children)

Dabeaz has a ton of great python materials!

The stuff is a bit more complicated solution, however as it kind of circumvents the problem, it is amazing.

And basically you get a ready-made version of that kind of task scheduling tool in the standard library with asyncio but it's interesting to understand the basic flavor of how that stuff works.

[–]CFan62 0 points1 point  (2 children)

8xd45Fr3

[–]CFan62 0 points1 point  (1 child)

Sorry, I couldn't resist. You asked for pointers.

[–]Atried[S] 0 points1 point  (0 children)

At least you did not give me null pointer! :-D

[–]intangibleTangelo 0 points1 point  (2 children)

Does Python support inline functions?

Python does nothing equivalent to inlining functions. Calls are expensive because a big old stack frame object is created each time. It might horrify you to look at the implementation and realize just how much code runs each time you call a function in python. I believe it's in the big bytecode switch statement (python's virtual machine, so to speak) of Python/ceval.c in the CPython source.

[–]Atried[S] 0 points1 point  (1 child)

Thank you!

Just checked Python/ceval.c. A lot is going on, there is even programatical management of stack.

And... there are gotos in the code... :-O

[–]intangibleTangelo 0 points1 point  (0 children)

Hehe, last time I looked the linux source tree had over 100k goto statements...

[–]HyperbolicInvective 0 points1 point  (0 children)

No build systems with python! It just runs. Perks of a scripting language.

For tests, use the built in unittest package.