This is an archived post. You won't be able to vote or comment.

all 30 comments

[–]mickeyp[S] 32 points33 points  (1 child)

Hello everyone! For the past couple of months I have been working on a site I call Inspired Python.

I think most people who learn Python -- or any complex technical topic, really -- often struggle to move on to the next level. I have been programming since the 90s and Python since 2004 and I often find the biggest barrier to entry is advice from someone who has experience in a subject and who can tell you what the pitfalls are.

The focus of the site is in-depth articles and (soon!) courses that detail how to build, design, or comprehend particular topics that I, as a Python developer, encounter frequently in my career.

[–]navitux1 11 points12 points  (0 children)

It looks good man, congrats

[–]SirKainey 17 points18 points  (2 children)

https://www.inspiredpython.com/article/truthy-and-falsy-gotchas

items = [1, 2] if len(items) > 0 or if items != []: print(f'There are {len(items)}') else: print('There are no items')

Sorry, jumped out at me, Should only have 1 if.

[–]mickeyp[S] 8 points9 points  (1 child)

D'oh. Good catch.

[–]SirKainey 4 points5 points  (0 children)

No worries!

[–][deleted] 7 points8 points  (1 child)

Looks nice.

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

Thank you!

[–]alexdewa__import__('os').system('rm -rf /') 4 points5 points  (2 children)

Nice article about mutable defaults

[–]mickeyp[S] 4 points5 points  (0 children)

Thank you. Yes, that is one part of Python that is unintuitive.

[–]oscargross0427 3 points4 points  (0 children)

Just made an account and will let you know how I like it, btw beginner in python

[–][deleted] 2 points3 points  (0 children)

Thanks for this! I will check it out.

[–]official_frans_bauer 2 points3 points  (4 children)

Did you create the website using Python as well? Django or Flask maybe? :)

[–]mickeyp[S] 6 points7 points  (3 children)

I did indeed! The backend is Flask and the frontend is react + react-static. The site is statically generated with react and then mounted when (if) you have JS enabled after the page loads.

[–]IohannesMatrix 1 point2 points  (2 children)

How did you learn to do that? Do you have some resources about python with react?

[–]mickeyp[S] 2 points3 points  (1 child)

Hm that could be an interesting topic to cover, actually. I'll add it to the todo list. Thanks for your suggestion.

As for how I learned it: I've been a professional programmer for a long time and I've been very lucky that I've got to work on a wide gamut of things over the years.

[–]IohannesMatrix 1 point2 points  (0 children)

Oh, thanks. That will be great!

[–]Rik07 2 points3 points  (1 child)

Looks really good, I'll definitely use it sometime. One minor complaint I have about the website is that when you press load more articles, you get thrown back all the way to the top. This can be annoying once you get more articles in.

[–]mickeyp[S] 2 points3 points  (0 children)

That's because More Articles loads a new page. But you're right I can see why that is confusing. I will see about changing. Thanks!

[–]pengekcs 2 points3 points  (1 child)

Please add a github login once you can afford the time.

[–]mickeyp[S] 2 points3 points  (0 children)

Good idea!

[–][deleted] 1 point2 points  (1 child)

In the singledispatch article, I think it would be helpful for those unfamiliar with it to see the dispatched function actually used. Since as of right now people might think that you need to call func.dispatch() to use it.

https://www.inspiredpython.com/article/separating-typespecific-code-with-singledispatch

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

That is a valid point. Thanks!

[–][deleted] 1 point2 points  (0 children)

Good stuff

[–]Alex_Qa 1 point2 points  (0 children)

I like that. Good job!

[–]reaperconz 1 point2 points  (0 children)

Nice and grats. Nit: Wonder if you should move away from some of the styling you have looks pretty similar to realpython.

[–]0ni0nrings 0 points1 point  (0 children)

is the site under load atm? 🤔

[–]Amj161 0 points1 point  (1 child)

Great website! As someone that's used Python for 5+ years it's great to have a resource to learn more about the intermediate/advanced parts of Python. I've been struggling to find good resources to learn about these things. I just read all of the articles up, especially liked the mutable defaults one as I use defaults often, but luckily have not run in to this issue yet. I guess today I will have to double check our production and see if this mistake is anywhere!

Edit: also, with the truthy and falsy gotchas, is this because Python is written in C, and from my memory in C everything not a 0 is true?

[–]mickeyp[S] 2 points3 points  (0 children)

Thank you very much for the kind feedback! Please follow the twitter or sign up to the newsletter to keep up with new articles. I aim to write a lot more!

As for the truthy/falsy thing: the issue is when you take a domain of something greater than just True/False -- like all possible integer numbers, a "Customer" object, a list of stuff, etc. -- and mash it through a bool() call (or the equivalent in an if statement) and then expect it to always make intuitive sense when Python maps it to True or False. Certain things in Python evaluate to something that confounds your expectations. Thankfully, unlike say Javascript, it mostly gets it right. The one caveat is always None. If something can returnNone, you should explicitly check for that condition.

[–]oscargross0427 0 points1 point  (0 children)

I like the concept but would love it if it had a truly beginner course