Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize import style #36

Closed
c24t opened this issue Jun 27, 2019 · 3 comments
Closed

Standardize import style #36

c24t opened this issue Jun 27, 2019 · 3 comments
Labels

Comments

@c24t
Copy link
Member

c24t commented Jun 27, 2019

From #29 (comment).

Should we:

  • use relative imports or always use absolute?
  • allow multiple imports per line? (@c24t says no, @Oberon00 says yes)
  • follow the google style guide and disallow importing classes and functions?
  • add a linter like isort to check that imports are sorted alphabetically?
@c24t
Copy link
Member Author

c24t commented Jul 3, 2019

From SIG call: if we're doing multiple classes per module then it makes sense to import modules instead of classes, in which case we'd also prefer to do one import per line. This also follows the google style guide.

As for isort: if it's worth commenting on, it's worth adding a lint check.

@Jamim
Copy link
Contributor

Jamim commented Aug 21, 2019

As for me, Google Python Style Guide is brain damaging and shouldn't be used anywhere outside of Google.

@c24t
Copy link
Member Author

c24t commented Sep 4, 2019

Using black means that we have to allow multiple imports per line to get consistent formatting with isort. We can still prefer importing modules by name to importing (e.g.) classes from modules.

srikanthccv pushed a commit to srikanthccv/opentelemetry-python that referenced this issue Nov 1, 2020
* Add Entry, EntryKey, EntryValue and EntryMetadata types

* Simplify Entry interface and add DistributedContext interface

* entryTtl -> ttl

* Simplify DistributedContext type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants