[EMAIL PROTECTED] wrote: > Thanks, John and Neil, for your explanations. > > Still I find it rather difficult to explain to a Python beginner why > this error occurs. > > Suggestion: shouldn't an error raise already when I try to assign s2? A > normal string should never be allowed to contain characters that are > not codable using the system encoding. This test could be made at > compile time and would render Python more didadic.
This is impossible because of backward compatibility, your suggestion will break a lot of existing programs. The change is planned to happen in python 3.0 where it's ok to break backward compatibility if needed. -- Leo. -- http://mail.python.org/mailman/listinfo/python-list