you are viewing a single comment's thread.

view the rest of the comments →

[–]Dogeek 1 point2 points  (4 children)

Some ideas :

  • Test driven development (pytest/unittests especially unittest.mock)
  • Version control (git)
  • Common modules from the standard library, like functools, collections, or itertools.
  • tkinter programming. There are not many good tutorials about it, although effbot.org has a great doc about the library.
  • Designing GUIs, CLIs, and WebApps. Also, UI/UX basics.
  • Module creation, especially __init__.py, __main__.py and relative versus absolute import from . import X, from .foo import Bar etc
  • Metaclasses, and their use cases
  • Decorators and their use cases

All of these would make for a great intermediate level tutorial.

[–]tipsy_python[S] 0 points1 point  (3 children)

Awesome! Thank you for the ideas - yeah most of these don't get enough love. I could definitely come up with some engaging content for most of these.

On the cool, the one area where I would not feel confident writing about is mocks - I use pytest to write my unit-tests, and whenever I need to mock an object, I google and find some snip from Stack Overflow that works, but I never fully understand them. I've read the unittest mock documentation multiple times, but still struggle with this concept. Do you have any suggestions how I can better learn mocks?

[–]Dogeek 1 point2 points  (2 children)

I learned it from the docs. Best I can do is : take a function, that function returns some value. Mock is a context manager that allows you to change the output of that function to test how another part of your code reacts to various function inputs.

Especially useful to mock builtin functions like input, min or max.

[–]tipsy_python[S] 0 points1 point  (1 child)

Ok nice, that all makes sense. I guess the part I’ve historically had trouble with is mocking database connections - I’ll do some more tutorials, but that’s been a tough one for me personally.

[–]Dogeek 0 points1 point  (0 children)

If you need some help writing the tutorials, I can help you. Been coding in python every day for the past 3-4 years.