Repetitive paths are confusing for both your tools and your developers. Unnecessary nesting doesn’t help anybody (unless they’re nostalgic for monolithic SVN repos). - Ken Reitz (the guy who wrote the Requests library)

Flat is better than nested. - PEP 20 - Zen of Python

tldr: Python projects often use repetitive paths, which seems weird and un-Pythonic.

wtf is a repetitive path?

First, what is a repetitive path?

Let me show you.

Go to Flask’s Github repo.

# root dir: Flask
├── docs
├── flask # here, too!
├── tests

Repeating ‘flask’ = repetitive path

repeat offenders

Same thing in mypy:

# root dir: mypy
├── docs
├── misc
├── mypy # we get it!

Django does it, and so does Celery, Guake, httpie.

There are some variations on the theme, too. pip does this:

# root dir: pip
├── docs
├── src
│   └── pip # somehow better and worse simultaneously
├── tests

sqlalchemy does this:

# root dir: sqlalchemy
├── doc
├── lib
│   └── sqlalchemy # fine, whatever
├── test

signs of hope

There are exceptions. pytest and Pillow both put their source code in, well, src.

Make sense, yes?

Pythonistas, help me understand

Strangest of all:

# root dir: requests
├── docs
├── requests # up is down, left is right
├── tests

I want to ask Python people about this.

I’d ask StackOverflow but the mob would sweep me away in a wave of downvotes. Maybe IRC…