keyword in package name.
Abhishek Mishra
abhishekmishra3 at gmail.com
Sun Oct 19 04:29:37 EDT 2008
On Oct 19, 12:11 pm, Tino Wildenhain <t... at wildenhain.de> wrote:
> Abhishek Mishra wrote:
> > Hello Everyone,
>
> > I have the habit of using domain names (of either the application or
> > company) in reverse in package names.
>
> > for e.g. com.spam.app1
>
> While this seemed a good idea for java, I don't think it makes
> sense for python - the reason: in python you have an import
> mechanism, where in java you just have namespaces.
>
> Therefore you can always avoid namespace clashes at import time.
>
Hi,
Thanks for your reply on a Sunday!
Here's my 2 cents on why I prefer this mechanism -
I would like not to worry about namespace clashes at import time.
Using a toplevel package which isolates your namespace from all
others, is a good idea in my opinion.
This could be a product name (like MoinMoin in MoinMoin), company name
(like google in google app engine - which is just one short of
com.google btw), or your DNS.
Therefore I use a domain name lots of times. (I admit that I picked up
this habit from programming a lot in java).
Although it looks like in this case I would have to use just the
project name.
Thanks & Regards,
Abhishek Mishra
More information about the Python-list
mailing list