First of all, yes I’m aware of PEP8 and the alphabetical method.
I do sort my imports first by the PEP8 recommendation:
- standard library imports
- related third party imports
- local application/library specific imports
But then, within each category, I like to sort by the length of the module name. Yes, it makes it look pretty, but then I find it arguably makes it easier to find a module than the alphabetical way.
Also, the shorter names tend to be the more basic, common modules (like
sys), so there’s an additional organization layer in that way. You know the length of the name you’re looking for, and the visual shape of the import list tells you very quickly where to look for names that long.
import os import sys import time import logging import argparse import subprocess import django import requests import webencodings import mymodule import localthing import supercustomstuff
Right now I mostly write for myself, and I don’t work with a team. But I intend to in the future. So what I’m wondering is, does anyone else do this, does anyone else see the sense in it, or will everyone else think I’m nuts?
Edit: Separate subgroups in example, as suggested by Mark Ransom, in order not to distract from the core issue about the ordering.
✓ Extra quality
ExtraProxies brings the best proxy quality for you with our private and reliable proxies
✓ Extra anonymity
Top level of anonymity and 100% safe proxies – this is what you get with every proxy package
✓ Extra speed
1,ooo mb/s proxy servers speed – we are way better than others – just enjoy our proxies!
USA proxy location
We offer premium quality USA private proxies – the most essential proxies you can ever want from USA
Our proxies have TOP level of anonymity + Elite quality, so you are always safe and secure with your proxies
Use your proxies as much as you want – we have no limits for data transfer and bandwidth, unlimited usage!
Superb fast proxy servers with 1,000 mb/s speed – sit back and enjoy your lightning fast private proxies!
99,9% servers uptime
Alive and working proxies all the time – we are taking care of our servers so you can use them without any problems
No usage restrictions
You have freedom to use your proxies with every software, browser or website you want without restrictions
Perfect for SEO
We are 100% friendly with all SEO tasks as well as internet marketing – feel the power with our proxies
Buy more proxies and get better price – we offer various proxy packages with great deals and discounts
We are working 24/7 to bring the best proxy experience for you – we are glad to help and assist you!