On Mon, Dec 30, 2013 at 6:38 AM, anatoly techtonik firstname.lastname@example.org wrote:
If Python is about readability then looking at your example, I have two questions:
- What is platform - hardware, CPU, OS, Python flavor?
- What is uname()?
For os.architecture I have only one question - what is the returned value? And it is easy to remember once you get it. It is also easy to debug.
You can also use platform.uname().machine if you prefer readability, but that doesn't work on Python 2.
Number of bits is sufficient only if you can always assume you're on the same architecture. It's much better to simply quote the uname value. And hey, you can even cut your code down from four lines to one:
If you get back a 404, obviously this platform's not supported. Bingo! You've just protected yourself against trying to download and run Intel code on an ARM chip.