From: Matthias Kievernagel on
Me:
>> If I don't want bytes to get passed to tkinter
>> I just have to raise an exception in AsObj, no?
>> Or is it even sufficient to just remove the bytes case?
Martin v. Loewis <martin(a)v.loewis.de> wrote:
> But why would you want that? There are commands which legitimately
> return bytes, e.g. the file and network io libraries of Tcl (not that
> you would usually want to use them in Python, but Tkinter is actually
> Tclinter, and should support all Tcl commands).

I'm just looking for a reliable error message when I pass
something to GUI functions which is not fit for display,
i.e. not a string. If bytes pass unnoticed,
I'll sooner or later have a surprise.
Just to make sure I decode all bytes (coming from a socket)
before I pass them on to the GUI.

Regards,
Matthias Kievernagel

From: Martin v. Loewis on
Matthias Kievernagel wrote:
> Me:
>>> If I don't want bytes to get passed to tkinter
>>> I just have to raise an exception in AsObj, no?
>>> Or is it even sufficient to just remove the bytes case?
> Martin v. Loewis <martin(a)v.loewis.de> wrote:
>> But why would you want that? There are commands which legitimately
>> return bytes, e.g. the file and network io libraries of Tcl (not that
>> you would usually want to use them in Python, but Tkinter is actually
>> Tclinter, and should support all Tcl commands).
>
> I'm just looking for a reliable error message when I pass
> something to GUI functions which is not fit for display,
> i.e. not a string. If bytes pass unnoticed,
> I'll sooner or later have a surprise.
> Just to make sure I decode all bytes (coming from a socket)
> before I pass them on to the GUI.

I see. I think it's just not possible to provide such a check,
given Tcl's (non-existent) type system.

Regards,
Martin