processing / processing/libprocessing

`width` & `height` are not accessible as globals across imported Python modules in the same directory

Offen
#162 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

A-Mewnala
Vorherrschende Sprache
Rust
Sterne
69
Forks
14
Ø Merge
15 T. 22 Std.
Gemergte PRs (30 T.)
3

Beschreibung

Unlike in Processing tabs that exist in the same folder, different Python modules in the same directory does not share width and height information. width and height have to be imported to the Class constructor for now as a workaround.

Example:
noc-2-mewnala-port > chapter2 > Example_2_6_Attraction

  • width and height are declared in Example_2_6_Attraction.py setup
  • Attractor.py and Mover.py are also trying to access width and height
    Note that there is no error anyway if we try to run the sketch without providing width and height to the Classes, but it isn't exposed to modules outside the one that has size(width, height) in the setup

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

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

Reproduziere das Verhalten in noc-2-mewnala-port/chapter2/Example_2_6_Attraction, bei dem setup width und height definiert, während Attractor.py und Mover.py darauf zugreifen. Beginne damit nachzuverfolgen, wie Module im selben Verzeichnis den Processing-Zustand erhalten; fertig ist es, wenn diese Module auf width und height zugreifen können, ohne sie an ihre Klassenkonstruktoren zu übergeben.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python, rust
Bereich
api, backend
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
50/100

Neue Issues direkt in Ihr Postfach

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