Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Namespace Packages
#1
I had a question regarding namespace packages:

https://packaging.python.org/guides/pack...-packages/

Let’s say I have several packages, a through z. All of these packages are part of a group but do not necessarily depend on one another so they would not all need to be installed at once as part of a parent package.

This appears to be the case that namespace packages were made for and it does say:

Quote:Each sub-package can now be separately installed, used, and versioned.

However, I know that just because a feature exists does not mean it should be used for it also says,

Quote:namespace packages come with several caveats and are not appropriate in all cases.

I am not sure I understand the caveats and the inappropriate use cases. What are the caveats? What are some inappropriate use cases?

I do note that it also says:

Quote:A simple alternative is to use a prefix on all of your distributions such as import mynamespace_subpackage_a (you could even use import mynamespace_subpackage_a as subpackage_a to keep the import object short).

and this approach does have some appeal in its simplicity.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  'namespace' shorthand for function arguments? shadowphile 5 2,584 Aug-11-2021, 09:02 PM
Last Post: shadowphile
  [PyKML] Loop through all Placemarks; Remove namespace Winfried 2 3,412 Aug-28-2020, 09:24 AM
Last Post: Winfried
  Beginner question: lxml's findall in an xml namespace aecklers 0 2,903 Jan-22-2020, 10:53 AM
Last Post: aecklers
  Namespace and scope difference Uchikago 9 4,579 Jul-03-2019, 03:36 PM
Last Post: Uchikago
  global namespace of an imported function (2 Qs) Skaperen 4 3,244 Oct-09-2018, 12:30 AM
Last Post: Skaperen
  local namespace vs. global namespace Skaperen 13 9,841 Jul-02-2017, 11:30 AM
Last Post: DeaD_EyE
  python import module or namespace from namepsace variable ? harun2525 11 8,618 May-23-2017, 05:39 PM
Last Post: Larz60+
  AttributeError: 'Namespace' object has no attribute 'brokeName' kikilalongue 4 24,479 May-22-2017, 12:00 PM
Last Post: kikilalongue
  python How to import All modules from namespace harun2525 1 8,363 May-20-2017, 10:10 AM
Last Post: buran
  Reusing same namespace name when writing back XML with xml.etree.ElementTree Ofnuts 1 9,847 Oct-21-2016, 07:25 AM
Last Post: Ofnuts

Forum Jump:

User Panel Messages

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