bslatkin / effectivepython

Effective Python: Second Edition — Source Code and Errata for the Book
https://effectivepython.com
2.2k stars 710 forks source link

Item #85: inconsistent spacing after `.` #91

Open jrib opened 3 years ago

jrib commented 3 years ago

I'm reading the book via oreilly.com in case the issue isn't present in other formats.

In "Item 85: Use Packages to Organize Modules and Provide Stable APIs":

Two examples seem to have spaces after . (in imports and attribute access). I learned that the python interpreter is actually ok with this (!)... I assume at the very least the space in utils. __all__ isn't intentional. The style for relative imports using . models instead of .models might be intentional but I don't think it's conventional.

In the import:

from . models import Projectile

In the imports and later in utils. __all__:

# __init__.py
__all__ = []
from . models import *

__all__ += models.__all__
from . utils import *
__all__ += utils. __all__
bslatkin commented 1 month ago

Thank you for the repot! I agree the space between should be removed.