Category: Python

  • Registration (and early-bird pricing) is open for Weekly Python Exercise

    Do you use Python, but sometimes feel stuck? Do you visit Stack Overflow every time you want to solve a problem? Do you wish that you understood how to use advanced techniques, such as generators and decorators, better? If so, then good news: I’m opening a new cohort of Weekly Python Exercise, specifically aimed at…

    Read more

  • Python dicts and memory usage

    Bottom line: Use sys.getsizeof to measure a dict’s memory: an empty dictionary takes 240 bytes, because it starts with eight slots ready for key-value pairs. That number reflects the structure, not the data, so it stays at 240 no matter how big your values are, growing in jumps only as you add more pairs. Let’s…

    Read more

  • Weekly Python Exercise A2 (functions + modules for beginners) closes today

    If you are a relative beginner to Python, and want to improve your understanding of functions and modules, then there’s no better way to do so than practice. Weekly Python Exercise provides you with that practice, with a family of six 15-week courses. In each course, you get a question on Tuesday, the answer on…

    Read more

  • “Python Workout” is Manning’s Deal of the Day!

    If you’ve just finished a Python course or book, then you might feel a bit nervous about your Python knowledge. You might be wondering how you can become a master Python developer, solving problems without turning to Stack Overflow every few minutes. The good news is that you can improve! But getting better at Python…

    Read more

  • My interview on the “Talk Python” podcast

    I was delighted to appear on the popular “Talk Python to Me” podcast, run by Michael Kennedy. In the podcast, I talk about teaching, learning, and teaching Python to companies. If you’re interested in how to learn better or teach better, then I think you’ll enjoy this episode! The episode is here: https://talkpython.fm/episodes/show/210/making-the-most-out-of-in-person-training

    Read more

  • Making your Python decorators even better, with functool.wraps

    Summary: Decorate your inner wrapper function with @wraps(func), imported from functools, and the decorated function keeps its original name, docstring, and signature. Without it, help() and name report “wrapper” and a generic (*args, **kwargs) signature. It’s one line of code, and I recommend adding it to every decorator you write. The good news: I gave…

    Read more

  • Get code + slides from my “Practical Decorators” talk from Euro Python / PyCon 2019

    I presented my “Practical Decorators” talk twice this year — once at PyCon 2019 in Cleveland, and again at EuroPython 2019 in Basel. Here is the video of my presentation in Cleveland: If you want to get the PDF of my slides, as well as the Python code that I showed, then just enter your…

    Read more

  • Announcing: Weekly Python Exercise A2 — functions and modules for Python beginners

    I spend just about every day teaching Python to people at companies around the world. I’m always amazed to see just how popular Python is, and how many people are using it — and in how many ways they are using it. But I’m also amazed by how many people are just “getting by” with…

    Read more

  • Improve your Python skills with my new book: Python Workout

    A few years ago, I noticed that many of the participants in my corporate Python courses were asking the same question: How can I get additional practice? And I have to say, this question made a lot of sense. After all, you can only absorb so much information from a course, regardless of how good…

    Read more

  • Announcing: My new NumPy course is live!

    Guess what?  Python is the #1 language for data science.  I know, it doesn’t seem like this should be true.  Python is a great language, and easy to learn, but it’s not the most efficient language, either in execution speed or in its memory usage. That’s where NumPy comes in: NumPy lets you have the…

    Read more