"""
Various utilities.
"""
# isstr check if object is of string type.
# This works for both python 2 and 3
# Taken from http://stackoverflow.com/questions/11301138/how-to-check-if-variable-is-string-with-python-2-and-3-compatibility
try:
basestring # attempt to evaluate basestring
def isstr(s):
return isinstance(s, basestring)
except NameError:
def isstr(s):
return isinstance(s, str)
-
Igor Dejanovic authored
SemanticAction now have a default behaviour which will reduce overhead in some common cases.
c2bfe117