· 2 min read

Advanced Python in German: 97 Flashcards on Decorators, Descriptors and Exceptions

German edition of Flip It's advanced Python deck: decorators, lambdas, exceptions, dunders and MRO, with German verbs to drill and 6 cards to fix before an interview.

Python snake coiled around a glowing lambda symbol beside a gift box and a German flag

Studying. But it's also a video game. 🎮

Flashcards, quizzes and games that make you actually remember.

Start playing — it's free

Posted by

Interviewing for a Python role in Berlin, Vienna or Zurich? JH1082 – Python: Fortgeschritten (Decorators, Lambda & Exceptions) is the German edition of Flip It's advanced Python deck. It has 97 cards with English fronts and German explanations. The English original is reviewed in Master Advanced Python. This article covers what the German version adds and which cards to fix first.

Study this deck: Python: Fortgeschritten (Decorators, Lambda & Exceptions)

1 / 10
Question

Metaclass in Python

Knew itLearning

Tap the card for the answer · swipe right if you knew it, left if not

Karten aus dem Deck

FrontBack
__new____new__ erzeugt die Instanz (gibt sie zurück), __init__ initialisiert sie (gibt None zurück)
__getattr__ vs __getattribute____getattr__ nur, wenn das Attribut NICHT gefunden wird; __getattribute__ bei JEDEM Zugriff
__setattr__self.x = y darin führt zu unendlicher Rekursion → object.__setattr__(self, 'x', y)
Can you stack multiple decorators?Ja, sie werden von unten nach oben angewendet
Limitations of lambda expressionsNur ein einzelner Ausdruck, keine Typannotationen, keine Schleifen
except: vs except Exception:Nacktes except: fängt auch SystemExit und KeyboardInterrupt ab
EAFPLieber um Vergebung bitten als um Erlaubnis fragen: versuchen, Exception abfangen
ExceptionGroup (Python 3.11+)Mehrere gleichzeitig ausgelöste Exceptions, abgefangen mit except*

Topics covered

Metaklassen and __prepare__, __init_subclass__, __class_getitem__, Descriptors (data vs non-data, lookup order), MRO and C3-Linearisierung, the diamond problem, kooperative Mehrfachvererbung, __slots__, __str__/__repr__, rich comparisons and functools.total_ordering, __hash__, reflected operators (__radd__), the container protocol (__getitem__, __contains__, __missing__), iterators, weakref, async protocols (__await__, __aenter__, __aiter__), decorators with arguments, functools.wraps, lru_cache, class-based decorators, lambdas with map/filter/sorted, closures, the walrus operator, try/except/else/finally, the BaseException hierarchy, custom exceptions, raise … from, assert and -O, EAFP vs LBYL, contextlib.suppress, @contextmanager, traceback.

Tipps für die deutsche Ausgabe

Read the title backwards. Cards 1-49 cover the object model: dunders, descriptors and MRO. Decorators begin at card 50, lambdas at 56 and exceptions at 60. Start with 50-97 if decorators and exceptions are what your interview will test.

Learn the German verbs, keep the English nouns. The deck uses the anglicisms German teams really say (Exception, Context Manager, Garbage Collector) but puts the verbs in German. Make reverse cards for auslösen (raise), abfangen (catch), erneut auslösen (re-raise) and unterdrücken (suppress, card 88). That way you can explain your own code in German, not just recognise it.

Fix these cards:

  • Fronts 74, 87 and 91 are sentence-cased: write functools.wraps, sys.exc_info() and functools.lru_cache. Python names are case-sensitive.
  • Card 5: the descriptor returns value, which is never defined. Store it in obj.__dict__ inside __set__.
  • Card 37: once __setattr__ raises, step 2 needs object.__setattr__ inside __new__. Otherwise your own constructor fails.
  • Card 63: if open() fails, f.close() raises NameError. Use with open(...).
  • Card 87: since 3.11, sys.exception() is simpler. Card 40's OrderedDict has been unnecessary since 3.6.

The Spanish edition of the same deck is covered too.

Find JH1082 – Python: Fortgeschritten (Decorators, Lambda & Exceptions) in the library on Flip It.

Ready to learn faster? 🚀

Join FLIP IT for free and turn studying into a game.

Create my free account