-
-
Notifications
You must be signed in to change notification settings - Fork 170
Open
Description
An interesting detail is that source_file_def_line method takes into account these types of objects and correctly finds the source code of the functions wrapped in these properties.
Lines 313 to 324 in e7c6baf
| def source_file_def_line(self): | |
| """ | |
| Number of line where the object is defined in its file. | |
| """ | |
| try: | |
| if isinstance(self.code_obj, property): | |
| sourcelines = self._getsourcelines(self.code_obj.fget) | |
| elif isinstance(self.code_obj, functools.cached_property): | |
| sourcelines = self._getsourcelines(self.code_obj.func) | |
| else: | |
| sourcelines = self._getsourcelines(self.code_obj) | |
| # getsourcelines will return the line of the first decorator found for the |
Metadata
Metadata
Assignees
Labels
No labels