Python Forum
Calls to Attributes of a Class
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calls to Attributes of a Class
#2
it depends what names are available on top level

>>> import openpyxl
>>> dir(openpyxl)
['DEFUSEDXML', 'LXML', 'NUMPY', 'Workbook', '__author__', '__author_email__', '__builtins__', '__cached__', '__doc__', '__file__', 
'__license__', '__loader__', '__maintainer_email__', '__name__', '__package__', '__path__', '__spec__', '__url__', 
'__version__', '_constants', 'cell', 'chart', 'chartsheet', 'comments', 'compat', 
'constants', 'descriptors', 'drawing', 'formatting', 'formula', 'load_workbook', 
'open', 'packaging', 'pivot', 'reader', 'styles', 'utils', 'workbook', 'worksheet', 'writer', 'xml']
load_workbook is made available/is exposed on top level

Here is the __init__.py source code
https://foss.heptapod.net/openpyxl/openp..._init__.py

In other words - it's a decision of the developer how to organise their code and what names to be exposed top level.
SKarimi likes this post
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
Calls to Attributes of a Class - by SKarimi - Apr-22-2021, 03:17 PM
RE: Calls to Attributes of a Class - by buran - Apr-22-2021, 04:14 PM
RE: Calls to Attributes of a Class - by SKarimi - Apr-22-2021, 04:18 PM
RE: Calls to Attributes of a Class - by buran - Apr-22-2021, 04:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question [solved] Classes, assign an attributes to a class not to instances.. SpongeB0B 4 891 May-20-2023, 04:08 PM
Last Post: SpongeB0B
  [Solved] Novice question to OOP: can a method of class A access attributes of class B BigMan 1 1,267 Mar-14-2022, 11:21 PM
Last Post: deanhystad
  Distinguishing different types of class attributes Drone4four 4 2,054 Feb-21-2022, 06:34 PM
Last Post: deanhystad
  SQL Alchemy dynamic class - declarative_base losing attributes mrdominikku 4 3,675 Jan-10-2020, 06:46 PM
Last Post: mrdominikku
  Need help with a function that calls other functions. skurrtboi 4 2,460 Sep-30-2019, 09:28 PM
Last Post: stullis
  how to add class instance attributes from list 999masks 2 2,661 Jul-22-2019, 07:59 AM
Last Post: 999masks
  Testing function calls jenselme 1 2,650 Jul-25-2018, 10:33 AM
Last Post: Larz60+
  function state between calls Skaperen 5 5,083 Feb-08-2018, 02:20 AM
Last Post: Skaperen
  Is it possible to loop through class attributes via string? 04chiak 3 9,717 Feb-04-2018, 09:29 PM
Last Post: 04chiak
  Is there another way to do a bunch of methods calls ? Windspar 7 4,623 Jan-02-2018, 06:26 PM
Last Post: Windspar

Forum Jump:

User Panel Messages

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