You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue:
When calling functions such as Spreadsheet.worksheet_by_title(), which return a custom class (such as Worksheet, Spreadsheet), intellisense cannot provide autocomplete intelligently unless you utilize function chaining.
@MoleyCode Unfortunately I only got a little ways into working on it before I fell in to some crunch at work and haven't come up for air -- feel free to take it!
Issue:
When calling functions such as Spreadsheet.worksheet_by_title(), which return a custom class (such as Worksheet, Spreadsheet), intellisense cannot provide autocomplete intelligently unless you utilize function chaining.
Consider the below:
worksheet = Spreadsheet.worksheet_by_title('Sheet1')
When utilizing the worksheet variable, intellisense doesn't know what to do, seeing it as type 'any'.
Solution:
Add appropriate type annotations to functions that return custom classes.
Example:
def worksheet_by_title(self, title): -> Worksheet
rather than
def worksheet_by_title(self, title):
I'd be happy to work on a PR for this myself if the author is amenable :)
The text was updated successfully, but these errors were encountered: