keyword in package name.

MRAB google at mrabarnett.plus.com
Sun Oct 19 16:17:03 CEST 2008


On Oct 19, 7:05 am, Abhishek Mishra <abhishekmish... at gmail.com> 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
>
> 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.
> I understand that this is an unfortunate "feature", but has anyone
> faced this problem before,
> and is there a possible workaround.
>
> P.S. this would also be a problem for the iceland domains (tld = .is).
> TLDs:http://data.iana.org/TLD/tlds-alpha-by-domain.txt
> Python Keywords:http://www.python.org/doc/2.5.2/ref/keywords.html
>
You could add a trailing underscore, ie "in_". This "fix" is done in
the poplib module where the POP3 class has a method called "pass_"
because "pass" is a reserved word.



More information about the Python-list mailing list