A suggestion for a possible Python module

Alex Martelli aleax at aleax.it
Tue Mar 4 10:15:02 EST 2003


Max M wrote:

> Alex Martelli wrote:
>> Max M wrote:
>> 
>> As we are being pedantic, I would suggest two more things:
> 
> 
> I was being pedantic you think? He asked for comments on a piece of code
> that he suggest is being included in the standard library. I assume that
> a certain level of pedantry is required then.

Yes, I think you were being pedantic, and I also think it was a good
and appropriate thing that you were.  I realize the emotional connotations
of "pedant" are not normally very good, but, really, it's an old and
honorable word meaning "schoolteacher" or (among other things) "a
formalist or precisionist in teaching", and I see nothing wrong with that.


>> 1. a clearer docstring,
>> it's only a small extra effort to SAY exactly what you mean, e.g.
>> "Returns a string with the same characters as the argument string,
>> in reverse order".
> 
> +1 on that one.

So moot it be.


>  > 2. no mixing of tabs with spaces (the docstring is aligned with a
>  >    tab while the other lines are aligned with spaces).
> 
> Ahh  naturally. This is what I get for coding in an email client ... I
> normally only use spaces, and I am so used to my editor doing it right
> that i didn't check what mozilla does. Bugger! Well it looked right when
> I sent it :-s

Yeah, sigh, happens to me too:-(.


>> Using "characters" rather than "letters" is also advisable in the
>> variable name, but even more important in the docstrings -- not all
>> characters are letters.
> 
> As Python has no char(acter) datatype, and many other languages does, I
> used "letter" to try and be as clear as possible. But probably you are
> right. "Characters" would have been a better description. I think it
> might have been a blind spot caused by english not being my first
> language.

I guess it depends on whether your mother tongue does distinguish
"letters" and "characters" in common speech -- I have indeed seen
this very same, slightly imprecise terminology, in other people with
Scandinavian mother tongues who are otherwise near-perfect speakers 
(or at least writers) of English.  No doubt I have my own similar
(or worse) imperfections, or even malapropisms, since Italian is
even farther from English in terminology (e.g., in common speech we
do not distinguish between 'time' and 'weather', using the same
word, 'tempo', for both -- hopefully this specific trap is big
enough that I can manage to avoid falling into it, but who knows
how many others there may be...!-).


Alex





More information about the Python-list mailing list