it:programmiersprache:python:strukturen

Dies ist eine alte Version des Dokuments!


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</wrap> * 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: ü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 * Module: Modul main.py in Paketen * Package
  • it/programmiersprache/python/strukturen.1789293752.txt.gz
  • Zuletzt geändert: 13.09.2026 10:02
  • von marsch