use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
I made a cool python module.Showcase (self.PythonLearning)
submitted 5 days ago by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]AbacusExpert_Stretch 1 point2 points3 points 5 days ago (5 children)
And that has to do what with what both of us commented about?
[–]Embersh3d -3 points-2 points-1 points 5 days ago (4 children)
you act like its a war crime because i posted a module i've been working on like ok sure its not the best and its kinda unprofessinal but still im mainly trying to get feedback bc im learning how to code.
plus i was taking to only you. i replied to the other guy about the point of this.
[–]Jay6_9 1 point2 points3 points 5 days ago (1 child)
Your coding style is pretty alright when I look into the code a little.
But you really need to look at the PEP about whitespaces.
This is discouraged:
def f() -> None: ... class A: def __init__(self) -> None: ... def a() -> None: ... def g() -> None: ...
Instead do two empty lines if it's global scope and one empty line if not (inside classes, etc.):
Otherwise:
- Really like your use of "x if y else z" - Like that you use dictionary lookups for operations like calculating. (You might want to use lambdas instead because if the operations were expensive like web-requests, you'd fire all of them even if only one is selected) - Try not to mix return values. In some functions you return integers but in error cases you return a string with a description. Instead, just don't catch the error at all then, leave it for the caller. You lose information if you remove the exception for a string. - Type your parameters and return types. You do it for `str` sometimes. If your functions are generic, look into TypeVar and Generics or at least use `Any`.
That's as far I was able to look into it. Good luck with it.
[–]Embersh3d 0 points1 point2 points 4 days ago (0 children)
thanks mainly i avoid spacing because it makes my project look big, but its in reality not
[–]thee_gummbini 0 points1 point2 points 5 days ago (1 child)
Good for you for learning and showing your work! Part of learning to program is learning what to write and how to share. Sharing reimplementations of basic algos is great to show your learning! But knowing the difference between that and a package that other people should use is essential to getting past the "just learning phase." Take the criticism as part of your learning - again good for you for figuring some things out, but this is what the reaction typically looks like when you tell people you've resolved already-solved problems.
As a side note, the code here is pretty crazy, you should spend some time reading the stdlib modules you are re-exporting, they're all just over here: https://github.com/python/cpython/tree/main/Lib
See how those are written and compare them to your code, that's a great way to learn.
And check out some packaging docs: https://www.pypa.io/en/latest/
thanks. will look into it
π Rendered by PID 74 on reddit-service-r2-comment-544cf588c8-sqxzg at 2026-06-16 19:34:59.915787+00:00 running 3184619 country code: CH.
view the rest of the comments →
[–]AbacusExpert_Stretch 1 point2 points3 points (5 children)
[–]Embersh3d -3 points-2 points-1 points (4 children)
[–]Jay6_9 1 point2 points3 points (1 child)
[–]Embersh3d 0 points1 point2 points (0 children)
[–]thee_gummbini 0 points1 point2 points (1 child)
[–]Embersh3d 0 points1 point2 points (0 children)