Eli Stevens (Gmail)
unread,Jun 26, 2014, 1:39:09 PM6/26/14Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to gen...@googlegroups.com
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