(self, suffix, node,
args=None, kwds=None, newobj=False)
| 532 | class classobj: pass |
| 533 | |
| 534 | def make_python_instance(self, suffix, node, |
| 535 | args=None, kwds=None, newobj=False): |
| 536 | if not args: |
| 537 | args = [] |
| 538 | if not kwds: |
| 539 | kwds = {} |
| 540 | cls = self.find_python_name(suffix, node.start_mark) |
| 541 | if newobj and isinstance(cls, type(self.classobj)) \ |
| 542 | and not args and not kwds: |
| 543 | instance = self.classobj() |
| 544 | instance.__class__ = cls |
| 545 | return instance |
| 546 | elif newobj and isinstance(cls, type): |
| 547 | return cls.__new__(cls, *args, **kwds) |
| 548 | else: |
| 549 | return cls(*args, **kwds) |
| 550 | |
| 551 | def set_python_instance_state(self, instance, state): |
| 552 | if hasattr(instance, '__setstate__'): |
no test coverage detected