Extracting values from text file
Mirco Wahab
wahab at chemie.uni-halle.de
Sun Jun 18 13:43:13 EDT 2006
Thus spoke Marc 'BlackJack' Rintsch (on 2006-06-18 18:54):
> In <e73sof$rjs$1 at mlucom4.urz.uni-halle.de>, Mirco Wahab wrote:
>> they use the _same_ operator (+) for number _addition_
>> and string _concatenation_, which is, imho, cumbersome.
>
> And ``+`` means also list/tuple concatenation and really anything for user
> defined types.
>
>> If you have an operator with meaning "add numbers" (+)
>> and one for "add strings" (.), the language could then
>> do the obvious for you.
>
> The dot also has already a meaning, it's the attribute lookup operator.
Yes, that may be the real reason?
>> Why would one go from C/C++ to "dynamical typed"
>> things, if he has to be so explicit on easy
>> things?
>
> Strings that act sometimes as strings and sometimes as numbers when used
> with ``+`` are quite confusing.
No, thats not what I tried to say, it's rather:
/things/ act _always_ as strings and _always_ as
numbers _when used_ as a 'string' or as a 'number'.
I don't consider that one 'confusing'.
> Two relevant lines from the Zen of Python:
> Explicit is better than implicit.
> In the face of ambiguity, refuse the temptation to guess.
This is, iirc, /exactly/ the reason why in (e.g.) Perl
they put sigils ($%@) in front of the variables. So all
gets explicit - there's no more ambiguity ...
> And don't mix up weakly and dynamically typed.
> Python is dynamically and strictly typed.
OK, right. I didn't separate 'strict' from
'weak' regarding data types.
I think I got used too much to these
nice 'backhand conversions'. I'm sure
I wouldn't have blinked once if I had
gone directly from C++ (or Java) to Python,
but now I have still the Perl disease in
my bones ;-)
Regards
Mirco
More information about the Python-list
mailing list