[Zope-dev] ZPT attributes and ""

Fred Drake fdrake at gmail.com
Wed Mar 18 08:26:58 EDT 2009


On Wed, Mar 18, 2009 at 7:59 AM, Roger Ineichen <dev at projekt01.ch> wrote:
> As far as I know it is valid to skip attributes for empty values
> but for some attributes it is not valid to use empty values.

Let's not use the term valid in this context, as it's pretty overloaded here.

In the general case, there's no way to know what string values can be
dropped silently, and it's wrong to assume that it can be done safely.

Using a special value (None, a.k.a. nothing in templates) is the only
reasonable indicator that an attribute should be dropped.


  -Fred

-- 
Fred L. Drake, Jr.    <fdrake at gmail.com>
"Chaos is the score upon which reality is written." --Henry Miller


More information about the Zope-Dev mailing list