[Zope-CMF] Re: Effective Date inconsistencies
Maurits van Rees
m.van.rees at zestsoftware.nl
Sat Jun 23 09:46:48 EDT 2007
Wichert Akkerman, on 2007-06-23:
> Previously Maurits van Rees wrote:
>> Wichert Akkerman, on 2007-06-23:
>> > I misread the interface; that only specified what should happen if no
>> > timezone is given. The interface says that the method should return a
>> > string which corresponds to the time or None if no time is set. So the
>> > behaviour you see is expected and can not be changed without breaking
>> > backwards compatibility.
>>
>> Where are you reading that? Products.CMFCore.interfaces.IDublinCore
>> only has some comments:
>
> Look at what interfaces/__init__.py does: it imports the interface from
> _content.py. DublinCore.py is a bbb stub.
Ah, there. :)
But that interface says:
Result is a string, formatted 'YYYY-MM-DD H24:MN:SS TZ', or None.
I parse that as:
Result is (a string, formatted 'YYYY-MM-DD H24:MN:SS TZ',) or None.
and not as:
Result is a string, formatted ('YYYY-MM-DD H24:MN:SS TZ' or 'None').
Put simpler, I parse that as:
Result is a string or None.
which seems just what Limi wants.
In zope.dublincore that I quoted, the idea was that the result is a
formatted string or an empty string. In other words, there it is
always a string, though it may be empty. At least the boolean values
of the empty string and None are the same: False, as opposed to
bool('None') which is True.
I am not sure where I am going with this line of reasoning :) but it
seems to me the zope.dublincore interface is slightly preferable,
always returning a string and still giving a good boolean value.
--
Maurits van Rees | http://maurits.vanrees.org/ [NL]
Work | http://zestsoftware.nl/
"Do not worry about your difficulties in computers,
I can assure you mine are still greater."
More information about the Zope-CMF
mailing list