MCPcopy Create free account
hub / github.com/TimMcCool/scratchattach / type

Method type

scratchattach/editor/mutation.py:88–104  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

86
87 @property
88 def type(self) -> Optional[ArgumentType]:
89 if not self._type:
90 if not self.mutation:
91 raise ValueError(
92 f"Cannot infer 'type' of {self} when there is no mutation attached. Consider providing a type manually."
93 )
94
95 i = 0
96 goal = self.index
97 for token in parse_proc_code(self.mutation.proc_code):
98 if isinstance(token, ArgumentType):
99 if i == goal:
100 self._type = token
101 break
102 i += 1
103
104 return self._type
105
106 @staticmethod
107 def from_json(data: dict | list | Any):

Callers

nothing calls this directly

Calls 1

parse_proc_codeFunction · 0.85

Tested by

no test coverage detected