logo

... black.


Odds are that you'll have lots of discussions on code style with your colleagues. Instead of argueing it may be a better idea to just have a standard that automatically formats all of your code. In this scenarios you may want to use black.


Episode Notes

All code will be formatted, not mere data containers. So if we start with this;

def open_up_this_here_file(filepath: os.PathLike, read_method: str = 'w', verbose: bool = True, debug: bool = False):
    """Does a whole bunch of things this one function does right here."""
    with open(filepath, read_method) as f:
        print(f.read())

We will end up with;

def open_up_this_here_file(
    filepath: os.PathLike,
    read_method: str = "w",
    verbose: bool = True,
    debug: bool = False,
):
    """Does a whole bunch of things this one function does right here."""
    with open(filepath, read_method) as f:
        print(f.read())

Feedback? See an issue? Feel free to mention it here.

If you want to be kept up to date, consider getting the newsletter.