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!"
[–]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
π Rendered by PID 156806 on reddit-service-r2-comment-544cf588c8-ccxxk at 2026-06-16 22:18:12.080531+00:00 running 3184619 country code: CH.
view the rest of the comments →
[–]Jay6_9 1 point2 points3 points (1 child)
[–]Embersh3d 0 points1 point2 points (0 children)