-
-
Notifications
You must be signed in to change notification settings - Fork 440
Open
Labels
good first issueGood issue for first-time contributorsGood issue for first-time contributorshelp wantedLooking for ContributorsLooking for Contributorstype:discussionDiscussion or feedback about the lessonDiscussion or feedback about the lesson
Description
In the Programming Style lesson the google style guide for writing function docstrings is mentioned, but the style of the example docstrings in the lesson do not follow the google style guide. It may be worth introducing users to the idea of a google style function docstring like the example in the google style guide:
def fetch_bigtable_rows(big_table, keys, other_silly_variable=None):
"""Fetches rows from a Bigtable.
Retrieves rows pertaining to the given keys from the Table instance
represented by big_table. Silly things may happen if
other_silly_variable is not None.
Args:
big_table: An open Bigtable Table instance.
keys: A sequence of strings representing the key of each table row
to fetch.
other_silly_variable: Another optional variable, that has a much
longer name than the other args, and which does nothing.
Returns:
A dict mapping keys to the corresponding table row data
fetched. Each row is represented as a tuple of strings. For
example:
{'Serak': ('Rigel VII', 'Preparer'),
'Zim': ('Irk', 'Invader'),
'Lrrr': ('Omicron Persei 8', 'Emperor')}
If a key from the keys argument is missing from the dictionary,
then that row was not found in the table.
Raises:
IOError: An error occurred accessing the bigtable.Table object.
"""
This would force new users to think about what a function does, what inputs it takes in, and what output it returns, thereby encouraging good style practices and reinforcing the learning goals for functions at the same time.
Metadata
Metadata
Assignees
Labels
good first issueGood issue for first-time contributorsGood issue for first-time contributorshelp wantedLooking for ContributorsLooking for Contributorstype:discussionDiscussion or feedback about the lessonDiscussion or feedback about the lesson