"0 in [True,False]" returns True

Fredrik Lundh fredrik at pythonware.com
Tue Dec 13 11:33:32 EST 2005


Mike Meyer wrote:

> > (for example, in <img ismap>, "ismap" is the value, not the attribute name.
> > it's up to the parser to figure out (from the DTD) that this value can only
> > be used by the "ismap" attribute, and interpret it as <img ismap=ismap>)
>
> But this isn't necessarilly true: <img alt=ismap> is perfectly legal.
> I would say that ismap only has one valid value - "ismap", so the
> parser knows that it should interepret a bare "ismap" as ismap=ismap,
> which gets you the same behavior in the end.

I think you could have figured out what I meant, but alright, replace
value with "enumeration value".  the "alt" attribute isn't an enumeration,
and cannot be minimized.

the point is that SGML lets you say things like

    "format can be one of A4, Letter, or Legal"

and then set the format simply by saying

    <document letter>

on the other hand, this means that you cannot say things like

    "paper can be one of A4, Letter, or Legal"
    "pdf-size can be one of A4, Letter, or Legal"

and use minimization for these attributes.

(unless I'm missing some obscure corner of the spec, HTML only uses
attribute minimization for boolean attributes, so exactly how this is
done doesn't really matter.  I'll better go *plonk* myself now...)

</F>






More information about the Python-list mailing list