L̶u̵m̶i̵n̷o̴u̶s̶m̶e̵n̵B̶l̵o̵g̵
504 subscribers
157 photos
32 videos
2 files
704 links
(ノ◕ヮ◕)ノ*:・゚✧ ✧゚・: *ヽ(◕ヮ◕ヽ)

helping robots conquer the earth and trying not to increase entropy using Python, Data Engineering and Machine Learning

http://luminousmen.com

License: CC BY-NC-ND 4.0
Download Telegram
Remember I told you about numbers from -5 to 255 interned. That is, the numbers are preliminary placed and cached in memory. So, there is more to it.

You can access this memory if you want and change value. Say, change literal 4 to value 5. I'll probably be damned by many people for this post, but here is a sample code:

>>> import ctypes
>>> ctypes.memmove(id(4) + 24, id(5) + 24, 8)
>>> print(2 * 2) # 5

Have fun debugging!

P.S. Try to replace 0 with 1

#python
The article on PythonSpeed compares three Python code analysis tools: Pylint, Flake8, and Ruff. Pylint is powerful but slow and complex, Flake8 is faster and simpler but less rigorous, and Ruff is a new tool that offers high speed with solid functionality, though it’s still maturing. The author suggests Ruff for new projects due to its balance of speed and features but acknowledges Pylint and Flake8 might be better suited for existing codebases.

🔗Link: https://pythonspeed.com/articles/pylint-flake8-ruff/

#article #python
💯4