it:programmiersprache:python:strukturen

Python Strukturen

  • Verzweigung – if, else
  • Auswahl – match, case (ab Python 3.10, (PEP 622), PEP 634, PEP 635, PEP 636)
  • Schleifen – For, while, else
  • Schleifen comprehension – y = x for x = …
  • Ausnahmebehandlung (Exceptions) - try/except/finally/else
  • with → Klassen (Context-Manager-Konzept)
  • Generatoren → yield
  • Iteratoren → Klassen (Iterator-Konzept)
  • Funktionen
    • Funktionen: variable Anzahl Parametern f(a, *b)
    • Funktionen: *args, **kwargs
    • Funktionen: erzwingen von Keyword Argumenten f(a, /, b) (ab ?, PEP 457)
    • Funktionen: erzwingen von Positionsargumenten f(a, /, b, *, c) (ab Python 3.8 - PEP 570)
    • Funktionen: Keyword only Parameter (ab Python 3.0 - PEP 3102)
    • Funktionen: überladen
    • Funktionen: Dekoratoren (Decorator)
    • Funktionen: Magische Funktionen → Klassen
    • Funktionen: Properties (nosetest, nose2)
    • Funktionen: das '*' an Funktionsnamen :?:
    • None vs. Exception
  • Module
    • Module: if __name__ == "__main__":
    • Module: PEP 299 – Special __main__() function in modules
  • Package
    • Package: Modul __main__.py in Paketen
  • it/programmiersprache/python/strukturen.txt
  • Zuletzt geändert: 15.09.2026 12:52
  • (Externe Bearbeitung)