classes and sub classes?
MRAB
python at mrabarnett.plus.com
Sun Apr 14 22:07:19 EDT 2013
On 15/04/2013 02:38, Jason Friedman wrote:
> > NwInvDb = NetworkInventoryDatabase, yes you are correct, it creates
> the database handle and makes it ready for use.
>
> I am interested in opinions. I for one dislike abbreviations on the
> theory that programs are read more than they are written. I would
> probably use this variable name:
>
> network_inventory_db_connection = ...
>
> And yes, I'm aware that "db" is an abbreviation. I believe I am
> following a few Zen principles:
>
> Beautiful is better than ugly.
> Explicit is better than implicit.
> Readability counts.
> Special cases aren't special enough to break the rules, Although practicality beats purity.
>
> What would others use?
>
"network" could be abbreviated to "net", "inventory" to "inv" (maybe OK
in this context; in another context it could an abbreviation for
"inverse"), and "connection" to "con" (maybe), giving "net_inv_db_con",
or "net_inv_db_connection".
The trick, of course, is to make it clear, but not annoyingly long.
Python itself has "def", "len", and "lstrip", not "define", "length"
and "left_strip".
More information about the Python-list
mailing list