Skip to content
This repository was archived by the owner on Oct 10, 2024. It is now read-only.
This repository was archived by the owner on Oct 10, 2024. It is now read-only.

What is the our Python import preference? #64

@ghost

Description

A)

import os
...
x = os.path.join(...)

B)

from os.path import join
...
x = join(...)

Discuss!

I think I prefer A? It makes it clearer when reading code what is being called, without having to check the imports, which might be a long way away from the code.

I don't think PEP8 covers this? (It says prefer on separate lines, prefer absolute imports where possible, and no wild card (*) imports).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions