Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Python Anti-Patterns

EuroPython Conference via YouTube

Overview

Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
Explore common anti-patterns in Python programming through this 28-minute conference talk from EuroPython 2021. Discover both general software anti-patterns and Python-specific issues, drawing insights from The Little Book of Python Anti-Patterns. Learn to identify and avoid problematic coding practices, including improper exception handling, misuse of context managers, inconsistent function return types, and inappropriate access of protected class members. Gain valuable knowledge on proper dictionary usage, import practices, variable naming conventions, and type comparisons. Suitable for developers with basic to intermediate Python knowledge, including familiarity with classes, constructors, and parameter usage.

Syllabus

Intro
Help you reach the next level
What exactly is a (design) pattern?
The AntiPattern on the other hand
Categories of the book
No exception type specified
Ignore context managers to handle files
Return more than one variable type in function calls
Accessing a protected member from outside the class
Assigning to built-in function
Using tabs or mixing tabs with spaces
Not using else where appropriate in a loop
Not using get() to return a default value from a dict
Using wildcard imports
Using the global statement
Using single letter to name your variables
Comparing things to True the wrong way
Using type() to compare types
Not using named tuples in function return

Taught by

EuroPython Conference

Reviews

Start your review of Python Anti-Patterns

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.