MCPcopy Index your code
hub / github.com/python/mypy / __enter__

Method __enter__

mypy/binder.py:115–129  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

113 self.discard = discard
114
115 def __enter__(self) -> Frame:
116 assert len(self.binder.frames) > 1
117
118 if self.break_frame:
119 self.binder.break_frames.append(len(self.binder.frames) - self.break_frame)
120 if self.continue_frame:
121 self.binder.continue_frames.append(len(self.binder.frames) - self.continue_frame)
122 if self.try_frame:
123 self.binder.try_frames.add(len(self.binder.frames) - 1)
124
125 new_frame = self.binder.push_frame(self.conditional_frame)
126 if self.try_frame:
127 # An exception may occur immediately
128 self.binder.allow_jump(-1)
129 return new_frame
130
131 def __exit__(self, exc_type: object, exc_val: object, exc_tb: object) -> Literal[False]:
132 self.binder.pop_frame(self.can_skip, self.fall_through, discard=self.discard)

Callers

nothing calls this directly

Calls 5

lenFunction · 0.85
appendMethod · 0.80
push_frameMethod · 0.80
allow_jumpMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected