keyword in package name.

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Mon Oct 20 01:36:08 CEST 2008

In message
<ecf20529-c99f-4a2d-95f0-289aeaa2c048 at>,
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