Larry Hastings <[email protected]> added the comment:
> > after all, they *are* instance variables.
> Technically, they are local variables.
Yeah, tbh I was thinking "instance of an invocation" here. But PEP 8 probably
means "instance of a class" here.
Still, there are three classes of naming things in Python: all uppercase
(constants), CapCase (class and exception names), and everything else
(lowercase with underscores). I suggest that arguments and local variables
belong in the latter camp. At no point does PEP 8 suggest naming anything in
lowercase without underscores.
> As "getgrouplist" or "sendfile". What about such argument names as
> "filename" and "newline"? If being a consistent in that, then it
> must be "follow_symbolic_links". And
> "source_directory_file_descriptor" instead "src_dir_fd".
You are muddling the issue--PEP 8 makes no ruling on abbreviations.
Personally, I prefer not to use abbreviations where possible. I've found over
the years that they are painfully ambiguous--I can never remember what
abbreviation I used. ("control" becomes... "ctl"? "cntl"?) MvL also makes a
good point that abbreviations are a hinderance to people who speak little or no
English.
That said, naming things after their POSIX counterparts has to be okay, and
abbreviations are occasionally called for when they are widely understood /
have a precedent in the library. So with every example you cite I prefer the
extant name over any counterproposal you explicitly suggested.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue15202>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com