Hungarian Notation

Carl Banks pavlovevidence at gmail.com
Tue May 27 03:03:53 EDT 2008


On May 27, 2:42 am, "inhahe" <inh... at gmail.com> wrote:
> Well, I just need it once in a while.  Actually now is the only time I
> remember.  The last time what I needed was a file name extension.  I want a
> string called headers, but I want to derive a dict from it, also called
> headers.  So I figured the string would be called strHeaders, and the dict,
> dctHeaders probably, but when a precedent for something like that exists, I
> like to use it.


I doubt there's anything canonical since Python community, PEP 8, and
Python's dynamic typing all discourage its use.  I would venture to
say that the community would frown upon names such as "strHeaders"
since they don't agree with the naming conventions in PEP 8.  Instead,
use "str_headers" and "dict_headers".  Better yet, use "headers_str"
and "headers_dict".  Put the less important information last.


Carl Banks



More information about the Python-list mailing list