Hacker News new | ask | show | jobs
by Godel_unicode 3487 days ago
You find "decimal" to be an inconveniently long name? In my experience "import...as" is reserved for things like PowerIterationClustering and the like. The overriding principle is to always choose readability over succinctness.
1 comments

Depends how often it's used. If you're just calling it once I wouldn't bother, but I was going off of makecheck's comment of, "if I had to write tons of those in code." I misread the style guide linked, I do find decimal.Decimal("12.34567") inconveniently long--but I generally don't mind inconveniently long names for increased intelligibility and the IDE does most of the heavy lifting. I don't often use "as" it's usually to increase the readability.

Similarly, I often see "from pprint import pprint as pp"