Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Post History

75%
+4 −0
Q&A What does "namespace" mean?

A well-known easter egg in Python displays some ideas about writing good Python code, credited to Tim Peters (one of the core developers). This question is about the last: Namespaces are one hon...

2 answers  ·  posted 12mo ago by Karl Knechtel‭  ·  last activity 12mo ago by Olin Lathrop‭

#1: Initial revision by user avatar Karl Knechtel‭ · 2023-12-02T06:03:39Z (12 months ago)
What does "namespace" mean?
A well-known [easter egg](https://stackoverflow.com/questions/43577404) in Python displays some ideas about writing good Python code, credited to Tim Peters (one of the core developers). This question is about the last:

> Namespaces are one honking great idea -- let's do more of those!

It seems that the concept of a "namespace" appears in programming generally, not just in Python. Presumably this concept is important, given its inclusion here. However, it's hard to pin down a clear definition simply from considering its use in context. For example, I have seen a class [`SimpleNamespace`](https://docs.python.org/3.8/library/types.html#types.SimpleNamespace) in the Python standard library; but it seems like the term is also used to describe things that are not actually objects in a program at runtime at all.

What exactly is a "namespace"? Does it refer to one specific concept that has particular properties regardless of the programming language? Or else how exactly should I understand it?