Linked by Eugenia Loli on Mon 20th Mar 2006 07:13 UTC
General Development All the data stored in a Python program is built around the concept of an object. Objects include fundamental data types such as numbers, strings, lists, and dictionaries. It's also possible to create user-defined objects in the form of classes or extension types. This chapter describes the Python object model and provides an overview of the built-in data types.
Thread beginning with comment 105952
To read all comments associated with this story, please click here.
namespace pollution
by project_2501 on Mon 20th Mar 2006 14:18 UTC
project_2501
Member since:
2006-03-20

python is a beautiful language - with only one major ugly problem - namespace pollution. even the texts and guides expect you to "import from" into the main namespace... ugly and bad practise.

python needs a better way of handling this. top level names should only be the core set of language keywords (for, if, def,..) and anything else should be structured and unambiguous and unable to clobber anything else. if there are function name lookup issues, as described in the article, that is an implementation issue, not a language design issue. you can cache the name lookup if you like....

Reply Score: 1

RE: namespace pollution
by modmans2ndcoming on Mon 20th Mar 2006 15:15 in reply to "namespace pollution"
modmans2ndcoming Member since:
2005-11-09

How is what Python does any different than the using statements from C++?

Reply Parent Score: 1

RE[2]: namespace pollution
by project_2501 on Mon 20th Mar 2006 15:25 in reply to "RE: namespace pollution"
project_2501 Member since:
2006-03-20

i don't know C++ so i can't answer. however both python and C++ provide means by which namespaces can be kept isolated and managed... but it is not enforced. that is my understanding.

Reply Parent Score: 1

RE: namespace pollution
by sbenitezb on Mon 20th Mar 2006 15:28 in reply to "namespace pollution"
sbenitezb Member since:
2005-07-22

Is not a problem if you know how to handle it. You are not required to "from foo import bar" , it's pure lazyness. But if you know you are not using bar in your code, or any other module with name bar, then it's ok to use it that way.

Programmers are smart (generally) people, unlike most users. They know their language and its shortcuts. Why is that bad?

Reply Parent Score: 1

RE[2]: namespace pollution
by project_2501 on Mon 20th Mar 2006 15:31 in reply to "RE: namespace pollution"
project_2501 Member since:
2006-03-20

its bad because programmers are human and humans make mistakes or oversights and get tired. convenience can be provided by IDEs like eclipse and netbeans... as they already do for Java.

Edited 2006-03-20 15:31

Reply Parent Score: 1