class_docstr: NLTK assumes all constants are of type ``EntityType`` (e) by default. We define this new class
  where we can pass a default type to the constructor and use that in the ``_set_type`` method.
class_docstr_tok: ["NLTK","assumes","all","constants","are","of","type","``","EntityType","``","(","e",")","by","default",".","We","define","this","new","class","where","we","can","pass","a","default","type","to","the","constructor","and","use","that","in","the","``","_set_type","``","method","."]
code: def __init__(self, variable, default_type):
      super(TypedConstantExpression, self).__init__(variable)
      self._default_type = default_type
  
imports: from __future__ import absolute_import
  from collections import defaultdict
  from nltk.sem.logic import Expression, ApplicationExpression, ConstantExpression, LogicParser, Variable
  from nltk.sem.logic import Type, BasicType, ComplexType, ANY_TYPE
  from allennlp.common.util import START_SYMBOL
label_desc: Use image node_id 1 to create a new TypedConstantExpression object from inherited base classes: ConstantExpression with example: obj = TypedConstantExpression(variable, default_type)