[Petal] attributes question

Evan Simpson evan at 4-am.com
Fri Jul 25 12:53:05 BST 2003


Jean-Michel Hiver wrote:
> The TAL spec states:
> 
>   If the expression associated with an attribute assignment evaluates to
>   nothing, then that attribute is deleted from the statement element.
> 
> In Petal, I considered nothing to be either undef or an empty string.

You may already know this, but for the benefit of those who don't, TAL 
does *not* treat the empty string (or zero, or any other false value) as 
'nothing'.  'nothing' is a singleton (Python None in our implementation) 
specifically meant to be distinct from all string, integer, etc values. 
  It has the same effect as an empty string in some cases (tal:replace, 
for instance) but not in tal:attributes.

Cheers,

Evan @ 4-am



More information about the Petal mailing list