4 ms·
http://dictionary.reference.com/browse/idiom http://dictionary.reference.com/browse/idiom An idiom is rather a preferred practice. If you take some time to re
by mekoka 15y ago
http://dictionary.reference.com/browse/idiom http://dictionary.reference.com/browse/idiom
An idiom is rather a preferred practice.
If you take some time to read through some Python source, you'll notice that, although the code uses the exact same constructs that you are used to in Java, it does so in a manner you might find unfamiliar or unpredictable.
One example is the use of try/except instead of if/else (beg for forgiveness rather than ask permission). Another is Duck-typing rather than Interface (if it quacks like a duck...)
Coming from Java and looking at some Python code without forewarning or context, you might just be tempted to label the whole thing as really really bad practice, when in truth, it's just Idiomatic Python.
- Goladus 15y agoTo be fair, though, some of the things on that list really do seem more like best practices, like advice not to use: from module import *