keyword in package name.

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Sun Oct 19 19:36:08 EDT 2008


In message
<ecf20529-c99f-4a2d-95f0-289aeaa2c048 at s9g2000prm.googlegroups.com>,
Abhishek Mishra wrote:

> 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
> 
> I've recently started a project for an indian domain (tld = .in),
> which leads to a package name like
> 
> in.spam.app1
> 
> This causes a syntax error, as "in" is a keyword.

The problem is that domain names aren't obliged to conform to any
programming language syntax. So using them directly in identifiers is
asking for trouble anyway. Best to avoid it.



More information about the Python-list mailing list