Skip to main content
r/learnpython icon

r/learnpython

members
online

Learn python and the field of solvers and graph algorithms Learn python and the field of solvers and graph algorithms

I order to understand mathematical optimization and graph algorithms better I wrote some myself in pure python. I recently bundled them all and published them on github.

If you are learning python and want to understand how to use and write your own solvers I can recommend you check out the project. It's open source, so feel free to fork it and play around. You can also pip or uv solvor since there is a pypi publication also.

Each solvor has its own little description, and I tried to keep the implementations as clear and self explanatory as possible. Any feedback is also welcome!

https://github.com/StevenBtw/solvOR


Your next job could start with Python. Here’s the roadmap Data Analysts follow. Start for free now.
Image Your next job could start with Python. Here’s the roadmap Data Analysts follow. Start for free now.


How do you learn proper API design standards when building your first Python APIs? How do you learn proper API design standards when building your first Python APIs?

I’ve been learning Python for backend development (FastAPI + Flask), and I’m struggling with something that most tutorials don’t explain clearly:

It’s easy to build endpoints… but how do you know if the API design actually follows good standards?

Like naming conventions, response structure, status codes, consistency, etc.

Right now I’ve been manually comparing my endpoints with OpenAPI examples, but it feels like guesswork. Is there a better way to learn API design the right way instead of picking up bad habits?

If you’ve built Python APIs before, how did you learn to keep everything consistent and “correct” according to best practices?


Is there anyone still add meta info at top of the python file? Is there anyone still add meta info at top of the python file?

APPEND(12-20 14:47 UTC): thanks to all guys those who responed to this post, your respones help a lot. A great disscusion!

about 10 years ago, when i first time to learn python, i saw some code with meta info on the top of the file, such as:

> """

@Description:

@Author: Foo

@Created at: 2024/1/10 16:11

@Copyright: (c) 2024, Bar

""" >

when i start do a job with python, no matter big company or small company, everyone create python file with these info.

I wonder as for now, is there anyone still add meta info at top of the python file? especially when we got tools like git.

The only reason the ai raised to keep this is that when you see these info decade years later, these may call your memory back :)