On 09/06/2012 07:15 AM, Dave Angel wrote: > On 09/06/2012 09:56 AM, Ray Jones wrote: >> I have a multiple 'if' expression that I need to drastically reduce in >> size, both for readability and to keep errors from creeping in. >> >> For example, I would like to have the variable 'test' point to the a >> location 'grid[rcount-1][ccount-1]' so that everywhere I would use >> 'grid.....', I could replace it with 'test' How would I accomplish that? >> >> Thanks. >> >> > Easiest way: switch to C++ > > There is no preprocessor in Python, and no addresses. There are some > places you could fake such stuff, but not the expression you have. > > If I HAD to do something like this for Python, I'd write a > preprocessor. But one reason I came to Python is its elegance, and a > preprocessor isn't elegant. Well, of all the..... a REAL programming language..... I mean, even Bash.... ;;))
Anyway, it was a shot. Thanks. Ray > _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor