#define (from C) in Python

Stefan Behnel stefan_ml at behnel.de
Thu Nov 12 18:16:02 CET 2009


Santiago Romero, 12.11.2009 17:43:
> Is there a Python version of C's language #define statements?
> 
> Example:
> 
> #define ReadMem( (x) )    memory[ (x) ]

Yes:

	ReadMem = memory.__getitem__

Stefan



More information about the Python-list mailing list