[Dev] Interationalization Schema Update

Andi Vajda vajda at osafoundation.org
Wed Jul 20 10:28:52 PDT 2005


>>>> The schema.Text type will raise an error if assigned either a Python 
>>>> unicode or str object. It only accepts LocalizableString's and UString's.
>>> 
>>> FYI, I *proposed* this, but I don't know what it would take to actually 
>>> implement; I seem to recall that the repository doesn't have any type 
>>> enforcement that would allow this to produce an immediate error.  Perhaps 
>>> Andi can comment?
>> 
>> The repository doesn't enforce types until commit. If the Text alias type 
>> doesn't recognize a value stored in an attribute upon commit, an error is 
>> raised.
>
> Pity.  It makes it harder to find where the broken assignment is in that 
> case, since the commit could be much later.

Of course, the type check could happen at set time, at the cost of 
performance. It's a trade-off I made a long time ago and that could certainly 
be revisited. I could also add a 'debug' mode that enforces type upon setting.

Andi..


More information about the Dev mailing list