Python Forum
global name 'thetime' is not defined
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
global name 'thetime' is not defined
#8
Gribouillis's solution is "smelly": not necessarily wrong but indicates the existence of a problem. In this case, the decorator creates a more-global namespace which is something that should be avoided. In a large program, you may have two thetime methods that you want to register... well, only one is getting used.

Namespaces are great and we need to do more of them, quoth the Zen of Python.
Reply


Messages In This Thread
RE: global name 'thetime' is not defined - by mpd - Jan-03-2018, 01:45 PM
RE: global name 'thetime' is not defined - by mpd - Jan-03-2018, 08:47 PM
RE: global name 'thetime' is not defined - by buran - Jan-03-2018, 09:18 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  python library not defined in user defined function johnEmScott 2 3,954 May-30-2020, 04:14 AM
Last Post: DT2000
  NameError: NameError: global name 'BPLInstruction' is not defined colt 7 4,550 Oct-27-2019, 07:49 AM
Last Post: Larz60+
  Global variable does not seem to be global. Columbo 6 3,803 Jul-15-2019, 11:00 PM
Last Post: Columbo
  NameError: Global Name is not defined MartinBerlin 3 41,348 Aug-25-2018, 09:03 AM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

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