def __init__(self, var):
        self.var = var
        self.literal = None
        self.lookups = None
        self.translate = False

        try:
            # First try to treat this variable as a number.
            #
            # Note that this could cause an OverflowError here that we're not
            # catching. Since this should only happen at compile time, that's
            # probably OK.
            self.literal = float(var)

            # So it's a float... is it an int? If the original value contained a
            # dot or an "e" then it was a float, not an int.
            if '.' not in var and 'e' not in var.lower():
                self.literal = int(self.literal)

            # "2." is invalid
            if var.endswith('.'):
                raise ValueError

        except __HOLE__:
            # A ValueError means that the variable isn't a number.
            if var.startswith('_(') and var.endswith(')'):
                # The result of the lookup should be translated at rendering
                # time.
                self.translate = True
                var = var[2:-1]
            # If it's wrapped with quotes (single or double), then
            # we're also dealing with a literal.
            if var[0] in "\"'" and var[0] == var[-1]:
                self.literal = mark_safe(var[1:-1])
            else:
                # Otherwise we'll set self.lookups so that resolve() knows we're
                # dealing with a bonafide variable
                self.lookups = tuple(var.split(VARIABLE_ATTRIBUTE_SEPARATOR))
dataset/ETHPy150Open dcramer/django-compositepks/django/template/__init__.py/Variable.__init__