Eli Stevens (Gmail)
2014-06-26 17:39:09 UTC
I just tried to use isinstance(myvar, dict) in a template, but got the
following exception:
TypeError: isinstance() arg 2 must be a class, type, or tuple of
classes and types
I got the repr(dict) and it said it was a lambda. Putting in the following:
<py:with vars="content_str = inspect.getsource(dict);">
${content_str}
I get the output from content_str:
'dict': lambda **kw: kw,
I feel fairly confident that this isn't due to anything I've written
directly, but haven't been able to rule out flask or the rest of the
stack I'm using.
Is this a known genshi-ism? Any idea why this would be useful?
For the record (and future searchers), isinstance(myvar, type({})
works well enough, though
Thanks,
Eli
following exception:
TypeError: isinstance() arg 2 must be a class, type, or tuple of
classes and types
I got the repr(dict) and it said it was a lambda. Putting in the following:
<py:with vars="content_str = inspect.getsource(dict);">
${content_str}
I get the output from content_str:
'dict': lambda **kw: kw,
I feel fairly confident that this isn't due to anything I've written
directly, but haven't been able to rule out flask or the rest of the
stack I'm using.
Is this a known genshi-ism? Any idea why this would be useful?
For the record (and future searchers), isinstance(myvar, type({})
works well enough, though
Thanks,
Eli
--
You received this message because you are subscribed to the Google Groups "Genshi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to genshi+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/genshi.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Genshi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to genshi+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/genshi.
For more options, visit https://groups.google.com/d/optout.