Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
importing an attribute
#4
Skaperen Wrote:what Python "mechanism" is involved that makes the attribute unavailable until it is imported.
This is what happens when 'session' is a submodule of a package 'botocore'. You only need a file structure like this
Output:
botocore/ __init__.py session.py
If there is no import session in __init__.py, then module botocore has no 'session' attribute but one can import botocore.session. You can also have a subpackage of course
Output:
botocore/ __init__.py session/ __init__.py
Reply


Messages In This Thread
importing an attribute - by Skaperen - Apr-14-2019, 03:06 AM
RE: importing an attribute - by woooee - Apr-14-2019, 05:13 AM
RE: importing an attribute - by Skaperen - Apr-14-2019, 05:48 AM
RE: importing an attribute - by Gribouillis - Apr-14-2019, 06:32 AM
RE: importing an attribute - by snippsat - Apr-14-2019, 08:17 AM
RE: importing an attribute - by Gribouillis - Apr-14-2019, 10:48 AM
RE: importing an attribute - by Skaperen - Apr-14-2019, 01:55 PM
RE: importing an attribute - by snippsat - Apr-14-2019, 03:54 PM

Forum Jump:

User Panel Messages

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