python / python/mypy

Clarify + validate python_version

Offen
#19,729 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

documentation feature topic-configuration
Vorherrschende Sprache
Python
Sterne
20.6k
Forks
3.3k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

The Python docs for python_version say:

Specifies the Python version used to parse and check the target program. The string should be in the format MAJOR.MINOR – for example 3.9. The default is the version of the Python interpreter used to run mypy.

My understanding was that you could even target a newer version of Python than the one that installed mypy, and that mypy implemented its own Python parser or something. But it seems like python_version only supports specifying older Python versions; i.e. only enables restricting syntax, not enabling syntax.

But what was even more confusing was that specifying --python-version 3.100 didn't show any errors.

I think the following changes would be good:

  1. Clarify the documentation to say that python_version is upper bounded to the version of Python running mypy
  2. Error if python_version is greater than the version of Python running mypy

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit der Dokumentation für python_version und der Behandlung der Befehlszeilenoption --python-version, und reproduziere dann das Ausbleiben eines Fehlers bei --python-version 3.100. Erledigt ist die Aufgabe, wenn die Dokumentation die Obergrenze angibt und eine Version außerhalb des gültigen Bereichs abgelehnt wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
devtools
Issue-Typ
Feature
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.