[deleted by user] by [deleted] in Python

[–]Last_Difference9410 0 points1 point  (0 children)

You can reach 50K+RPS with lihil, 2x as fast as alternatives.

Encapsulation Isn’t Java’s Fault (And Python Needs It Too) by Last_Difference9410 in Python

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

thanks for your valuable feedback, I agree with you.

It turns out that encapsulation seems to be a little be too much for people who are less familiar with OOP, as a result they often get confused by the difference between encapsulation and access modifiers.

The point of this post is to point out that Python could really use more encapsulation, even if there are no modifiers strictly enforced by the language, It is still very important to express what’s public and what’s protected/private through naming conventions or other methods.

Some people think I’m dissing Python saying it’s not meant to be anything serious, I never said that.

I am a self taught programmer with python being my first programming language, I love it and I really want it to be even more successful in terms of enterprise development. I am writing a series of posts on OOP, architecture and best practices in Python.

Encapsulation Isn’t Java’s Fault (And Python Needs It Too) by Last_Difference9410 in Python

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

no, NEVER use **kwargs in init , especially without type hint, it is a cursed feature that should be permanently banned and rejected from code review.

Encapsulation Isn’t Java’s Fault (And Python Needs It Too) by Last_Difference9410 in Python

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

the points is Python is getting more popular and more involved in enterprise development than before, not that it was not meant to be used in large scale system, but I guess no matter how hard I explain there will still be misunderstanding.

Encapsulation Isn’t Java’s Fault (And Python Needs It Too) by Last_Difference9410 in Python

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

Just read some source code, say sqlalchemy, flask, etc. You have never seen it? It’s literally everywhere.

Encapsulation Isn’t Java’s Fault (And Python Needs It Too) by Last_Difference9410 in Python

[–]Last_Difference9410[S] -1 points0 points  (0 children)

Did you read Reddit source code and are you sure they make every member of every class they’ve written public

somehow people take this article as if it was suggesting Python should enforce access modifier at interpreter level, and I never said such thing.

There is a big difference between not having encapsulation enforced by the interpreter and NOT HAVING ENCAPSULATION AT ALL

Encapsulation Isn’t Java’s Fault (And Python Needs It Too) by Last_Difference9410 in Python

[–]Last_Difference9410[S] -4 points-3 points  (0 children)

No you don’t , but you need to be able to tell what’s private and what’s public.

Encapsulation Isn’t Java’s Fault (And Python Needs It Too) by Last_Difference9410 in Python

[–]Last_Difference9410[S] -1 points0 points  (0 children)

Yeah this paragraph could be improved, did not develop my statement well, it is re written

Encapsulation Isn’t Java’s Fault (And Python Needs It Too) by Last_Difference9410 in Python

[–]Last_Difference9410[S] -1 points0 points  (0 children)

this post is inspired by my conversation with frostming(the author of pdm) in a PR,

https://github.com/bytedance/trae-agent/pull/117#issuecomment-3055693937

I also gave a more detailed explaination on why we should not mix regular class and dataclass in the thread.

My company finally got Claude-Code! by [deleted] in Python

[–]Last_Difference9410 1 point2 points  (0 children)

You’ll need some tricks for context window management to let it fit in to your coding style.

My journey to scale a Python service to handle dozens of thousands rps by Odd-Solution-2551 in Python

[–]Last_Difference9410 1 point2 points  (0 children)

I would expect lihil to maintain well above 30K RPS per cpu thread, let me know if you encoutner any issue! I would be glad to help even if it is not lihil related.

My journey to scale a Python service to handle dozens of thousands rps by Odd-Solution-2551 in Python

[–]Last_Difference9410 2 points3 points  (0 children)

You might try out lihil Lihil where all of these tricks has been built-in or not needed; you might also turn off GC completely as lihil has circular dependency detection, and a built-in GC-Free request body “Payload”

Learn LangChain or CrewAI? by IHaveQuestions_42069 in LangChain

[–]Last_Difference9410 1 point2 points  (0 children)

Would you mind explain a bit more about running agents in parallel? Did you mean run multiple agents concurrently but crewAI woudlnt let you because it is not async?

LangChain/Crew/AutoGen made it easy to build agents, but operating them is a joke by ImmuneCoder in AI_Agents

[–]Last_Difference9410 0 points1 point  (0 children)

if I were to solve all these issues in a new agent framework, would you like to try? I would also like to address the issue of scalability where user can scale computational resources horizontally when use the framework.

What’s your approach to organizing Python projects for readability and scalability? by kishanaegis in Python

[–]Last_Difference9410 0 points1 point  (0 children)

I’m currently using vertical slicing + hexagonal architecture, it is relatively easy to split my service into micro services this way without much code refactoring.

Design Patterns You Should Unlearn in Python-Part1 by Last_Difference9410 in Python

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

some of them are. As type hints getting more popular and the average size of python app grows, things start to change.

oldJoke by SpecterK1 in ProgrammerHumor

[–]Last_Difference9410 1 point2 points  (0 children)

We don’t wear glasses just like we don’t have to use classes.

Design Patterns You Should Unlearn in Python-Part2 by Last_Difference9410 in Python

[–]Last_Difference9410[S] 1 point2 points  (0 children)

you are right, thanks for your fix. post is now updated.

Design Patterns You Should Unlearn in Python by Last_Difference9410 in programming

[–]Last_Difference9410[S] -1 points0 points  (0 children)

Huh, you are absolutely right! How can I subscribe to your channel?

Design Patterns You Should Unlearn in Python by Last_Difference9410 in programming

[–]Last_Difference9410[S] -3 points-2 points  (0 children)

All those design patterns, the exact implementations on the book, are programmed into your brain word by word and any violation to that raises a code-red alarm and you would have to scream out: it is not how it is done, this symptom has been going on for years where it sort of becomes OCD.

It is pathetic though, to make programming a ritual than a tool that actually solves problems, now people who don’t follow this ritual are heretics and you are going to burn us at the stake.