Return a list of tuples (name, value) for all arguments. If 'var' is set True, also include the variable and keyword arguments when present.
(self, var: bool = False)
| 177 | return saferepr(object) |
| 178 | |
| 179 | def getargs(self, var: bool = False): |
| 180 | """Return a list of tuples (name, value) for all arguments. |
| 181 | |
| 182 | If 'var' is set True, also include the variable and keyword arguments |
| 183 | when present. |
| 184 | """ |
| 185 | retval = [] |
| 186 | for arg in self.code.getargs(var): |
| 187 | try: |
| 188 | retval.append((arg, self.f_locals[arg])) |
| 189 | except KeyError: |
| 190 | pass # this can occur when using Psyco |
| 191 | return retval |
| 192 | |
| 193 | |
| 194 | class TracebackEntry: |