Python Forum
global namespace of an imported function (2 Qs)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
global namespace of an imported function (2 Qs)
#2
The namespace is created when it is imported, and I believe only when it is first imported. Any top-level code in the module is executed at that time, and can access anything defined above it in that namespace.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
RE: global namespace of an imported function (2 Qs) - by ichabod801 - Oct-08-2018, 02:07 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Can a module tell where it is being imported from? stevendaprano 3 1,231 Apr-12-2022, 12:46 AM
Last Post: stevendaprano
  Function global not readable by 'main' fmr300 1 1,391 Jan-16-2022, 01:18 AM
Last Post: deanhystad
  module detecting if imported vs not Skaperen 1 1,713 Nov-19-2021, 07:43 AM
Last Post: Yoriz
  'namespace' shorthand for function arguments? shadowphile 5 2,669 Aug-11-2021, 09:02 PM
Last Post: shadowphile
  [newbie] Why is a module imported twice? Winfried 3 4,119 Apr-02-2021, 04:48 AM
Last Post: deanhystad
  Finding global extrema of oscillating function JoeRogan 0 1,681 Dec-22-2020, 01:49 AM
Last Post: JoeRogan
Star NameError – function doesn't recognize imported modules Sir 4 3,609 Dec-01-2020, 06:36 AM
Last Post: Sir
  How to make global list inside function CHANKC 6 3,195 Nov-26-2020, 08:05 AM
Last Post: CHANKC
  Spyder Quirk? global variable does not increment when function called in console rrace001 1 2,271 Sep-18-2020, 02:50 PM
Last Post: deanhystad
  [PyKML] Loop through all Placemarks; Remove namespace Winfried 2 3,495 Aug-28-2020, 09:24 AM
Last Post: Winfried

Forum Jump:

User Panel Messages

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