inconvenient unicode conversion of non-string arguments

Holger Joukl Holger.Joukl at LBBW.de
Wed Dec 13 06:47:58 EST 2006


python-list-bounces+holger.joukl=lbbw.de at python.org schrieb am 13.12.2006
12:05:33:

> Holger Joukl wrote:
>
> >>> Ok, but I still don't see why these arguments shouldn't simply be
> >>> silently ignored
>  >>
> >>  >>> import this
> >
> > You probably refer to "Explicit is better than implicit.".
>
> "Errors should never pass silently." is a better match, I think.  you're
> trying to do an invalid operation.  python tells you to fix your code.
>
> </F>

I'm not doing an invalid operation with
unicode(17.3)
What's invalid about unicode(17.3, "latin-1", "replace")?
IMHO the encoding/errors args can only ever apply for string arguments so
this could well fall back to unicode(17.3).

Might be I'm overlooking something grave, but I'm still not convinced.

But thanks for your advice,
Holger

Der Inhalt dieser E-Mail ist vertraulich. Falls Sie nicht der angegebene
Empfänger sind oder falls diese E-Mail irrtümlich an Sie adressiert wurde,
verständigen Sie bitte den Absender sofort und löschen Sie die E-Mail
sodann. Das unerlaubte Kopieren sowie die unbefugte Übermittlung sind nicht
gestattet. Die Sicherheit von Übermittlungen per E-Mail kann nicht
garantiert werden. Falls Sie eine Bestätigung wünschen, fordern Sie bitte
den Inhalt der E-Mail als Hardcopy an.

The contents of this  e-mail are confidential. If you are not the named
addressee or if this transmission has been addressed to you in error,
please notify the sender immediately and then delete this e-mail.  Any
unauthorized copying and transmission is forbidden. E-Mail transmission
cannot be guaranteed to be secure. If verification is required, please
request a hard copy version.





More information about the Python-list mailing list