Python Forum
global variables, classes, imports
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
global variables, classes, imports
#11
In Python, anytime a variable is referenced, it will be looked for in the local scope, then enclosing scope, up to global. Methods are no different than functions in this way.
Reply


Messages In This Thread
global variables, classes, imports - by Skaperen - Feb-17-2017, 07:17 AM
RE: global variables, classes, imports - by wavic - Feb-17-2017, 09:56 AM
RE: global variables, classes, imports - by Larz60+ - Feb-17-2017, 06:11 PM
RE: global variables, classes, imports - by Larz60+ - Feb-18-2017, 01:29 PM
RE: global variables, classes, imports - by micseydel - Feb-19-2017, 04:37 AM
RE: global variables, classes, imports - by buran - Feb-26-2017, 09:49 AM
RE: global variables, classes, imports - by buran - Mar-02-2017, 08:37 AM
RE: global variables, classes, imports - by Mekire - Mar-02-2017, 05:06 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Trying to understand global variables 357mag 5 1,065 May-12-2023, 04:16 PM
Last Post: deanhystad
  Organizing several similar classes with overlapping variables 6hearts 7 1,331 May-07-2023, 02:00 PM
Last Post: 6hearts
  Global variables or local accessible caslor 4 985 Jan-27-2023, 05:32 PM
Last Post: caslor
  global variables HeinKurz 3 1,102 Jan-17-2023, 06:58 PM
Last Post: HeinKurz
  Clarity on global variables JonWayn 2 905 Nov-26-2022, 12:10 PM
Last Post: JonWayn
  Imports that work with Python 3.8 fail with 3.9 and 3.10 4slam 1 2,551 Mar-11-2022, 01:50 PM
Last Post: snippsat
  Imports in my first package cuppajoeman 1 1,912 Jun-28-2021, 09:06 AM
Last Post: snippsat
  script with imports works but pytest gives "ModuleNotFoundError"? Hpao 0 1,544 Jun-27-2021, 08:30 PM
Last Post: Hpao
  Help wanted with python imports petros21 3 2,481 Apr-07-2021, 07:16 PM
Last Post: snippsat
Question How to include Modules not found (conditional imports) in my setup.py when I want to cff 0 3,767 Mar-17-2021, 11:57 AM
Last Post: cff

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020