Whenever I see references to modules like SciPy and NumPy the first letter of each part is capitalized. However they must be imported with all lowercase letters. Why is there this difference?
There are indeed official standards: Modules should have short, all-lowercase names. Underscores can be used in the module name if it improves readability. Python packages should also have short, all-lowercase names, although the use of underscores is discouraged.
Variables can only contain upper and lowercase letters (Python is case-sensitive) and _ (the underscore character). Hence, because we can't have spaces in variable names a common convention is to capitalize the first letter of every word after the first.
A programming language is said to be case sensitive if it distinguishes between uppercase and lowercase letters. Python is a `case sensitive programming language. Variable, functions, modules and package names are written in lowercase by convention.
Python compares strings lexicographically, using the constituent characters based on their ASCII or Unicode code points. The same principle applies for Python3. In ASCII, and therefore in Unicode, lowercase letters are greater than all uppercase letters.
The difference is basically in branding. As per the style guide: https://www.python.org/dev/peps/pep-0008/#package-and-module-names module names should be short and all lower cased. One reason for that is that when you are importing a module, it would be inconvenient if you had to remember all the capitalizations in the name. Big packages like NumPy and SciPy follow this convention, but when they are referring to themselves (or when others are referring to them) they like to include the stylistic capitalizations. It's mostly a style/branding choice.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With