durusmail: quixote-users: Quixote changing object type, from list to _QuoteWrapper
Quixote changing object type, from list to _QuoteWrapper
2003-01-27
2003-01-27
2003-01-27
2003-01-27
2003-01-27
2003-01-27
2003-01-27
Quixote changing object type, from list to _QuoteWrapper
Nicola Larosa
2003-01-27
 > The htmltext object does not implement __getitem__, etc.

That woulbe nice, I guess. But...


 > It probably should but there are usually nicer ways to get the desired
 > behavior.

Like, not letting an htmltext object be involved with a list in the first
place? :^)


 >> because Quixote changes the type of the interface["services"] list to:
 >> 

 > I don't think so. Can you show me some code?

Here it is:

interfaces = self._getInterfaces()
...stuff deleted...
for interface in interfaces:
      """\
      ...HTML markup deleted...
      """ % interface
      if interface["numServices"]:
          service = interface["services"][0]
      else:
          ...other stuff deleted...


 > I don't understand the attachment.

It's part of the output from two different executions of the template, with
[plain] and [html] each time in the definition.


 > Normally the _QuoteWrapper object should be hidden (it's
 > only used for implementing the % operator).

Maybe it's called by the interpolation of the "interface" dict values in the
markup between the "for" and the "if".


--
"Python is the Beatles of programming languages."
    Aaron K. Johnson on comp.lang.python

Nicola Larosa - nico@tekNico.net



reply