r/Python • u/AutoModerator • Jul 28 '26
Daily Thread Tuesday Daily Thread: Advanced questions
Weekly Wednesday Thread: Advanced Questions 🐍
Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices.
How it Works:
Ask Away: Post your advanced Python questions here.
Expert Insights: Get answers from experienced developers.
Resource Pool: Share or discover tutorials, articles, and tips.
Guidelines:
This thread is for advanced questions only. Beginner questions are welcome in our Daily Beginner Thread every Thursday.
Questions that are not advanced may be removed and redirected to the appropriate thread.
Recommended Resources:
If you don't receive a response, consider exploring r/LearnPython or join the Python Discord Server for quicker assistance.
Example Questions:
How can you implement a custom memory allocator in Python?
What are the best practices for optimizing Cython code for heavy numerical computations?
How do you set up a multi-threaded architecture using Python's Global Interpreter Lock (GIL)?
Can you explain the intricacies of metaclasses and how they influence object-oriented design in Python?
How would you go about implementing a distributed task queue using Celery and RabbitMQ?
What are some advanced use-cases for Python's decorators?
How can you achieve real-time data streaming in Python with WebSockets?
What are the performance implications of using native Python data structures vs NumPy arrays for large-scale data?
Best practices for securing a Flask (or similar) REST API with OAuth 2.0?
What are the best practices for using Python in a microservices architecture? (..and more generally, should I even use microservices?)
Let's deepen our Python knowledge together. Happy coding! 🌟
1
u/Nobel_Worker Aug 04 '26
According to the python documentation standard %-formatting is actually preferred for logging because it is lazily evaluated. If you use f-string, the string is evaluated immediately even if the log level (like DEBUG) is disabled, which can cause minor performance overhead. So %-formatting wins here for logging!
1
u/No_Departure_1878 Jul 30 '26
A bunch of those advanced topics are just things that you should not be doing in python at all. Doesn't it make more sense to just write a small rust library if you want to do numerical stuff or mulithreaded stuff? From what I understand, integrating rust into python is easier than dealing with Cython or with C/C++ python bindings.
I think you are confusing "advanced concepts" with "this is not what python was meant for, so we made it hard for you to do it this way".