def __init__(self, evaluator, base, var_args=()):
     super(Instance, self).__init__(evaluator, base, var_args)
     if str(base.name) in ['list', 'set'] \
             and compiled.builtin == base.get_parent_until():
         # compare the module path with the builtin name.
         self.var_args = iterable.check_array_instances(evaluator, self)
     else:
         # need to execute the __init__ function, because the dynamic param
         # searching needs it.
         with common.ignored(KeyError):
             self.execute_subscope_by_name('__init__', self.var_args)
     # Generated instances are classes that are just generated by self
     # (No var_args) used.
     self.is_generated = False
Beispiel #2
0
 def __init__(self, evaluator, base, var_args=()):
     super(Instance, self).__init__(evaluator, base, var_args)
     if str(base.name) in ['list', 'set'] \
             and compiled.builtin == base.get_parent_until():
         # compare the module path with the builtin name.
         self.var_args = iterable.check_array_instances(evaluator, self)
     else:
         # need to execute the __init__ function, because the dynamic param
         # searching needs it.
         with common.ignored(KeyError):
             self.execute_subscope_by_name('__init__', self.var_args)
     # Generated instances are classes that are just generated by self
     # (No var_args) used.
     self.is_generated = False
Beispiel #3
0
    def __init__(self, evaluator, base, var_args, is_generated=False):
        super(Instance, self).__init__(evaluator, base, var_args)
        self.decorates = None
        # Generated instances are classes that are just generated by self
        # (No var_args) used.
        self.is_generated = is_generated

        if base.name.get_code() in ['list', 'set'] \
                and compiled.builtin == base.get_parent_until():
            # compare the module path with the builtin name.
            self.var_args = iterable.check_array_instances(evaluator, self)
        elif not is_generated:
            # Need to execute the __init__ function, because the dynamic param
            # searching needs it.
            try:
                method = self.get_subscope_by_name('__init__')
            except KeyError:
                pass
            else:
                evaluator.execute(method, self.var_args)
    def __init__(self, evaluator, base, var_args, is_generated=False):
        super(Instance, self).__init__(evaluator, base, var_args)
        self.decorates = None
        # Generated instances are classes that are just generated by self
        # (No var_args) used.
        self.is_generated = is_generated

        if base.name.get_code() in ['list', 'set'] \
                and compiled.builtin == base.get_parent_until():
            # compare the module path with the builtin name.
            self.var_args = iterable.check_array_instances(evaluator, self)
        elif not is_generated:
            # Need to execute the __init__ function, because the dynamic param
            # searching needs it.
            try:
                method = self.get_subscope_by_name('__init__')
            except KeyError:
                pass
            else:
                evaluator.execute(method, self.var_args)