Skip to content

Review usage of packages (files) and directories in Python #478

@alexjpwalker

Description

@alexjpwalker

Problem to Solve

Our Python project structure doesn't currently feel very "Pythonic". In Python, it's conventional to have fewer files, because Python packages are files.

Current Workaround

We have a hybrid model - some of our directories (eg: grakn, grakn/common) use a more Python-like structure where a file is used as a package and contains multiple related classes (eg: client.py, exception.py); other directories (e.g. concept) use a more Client Java-like structure where a directory contains multiple related packages which each contain a single class.

The case where this gets really ugly is Concept; we write from grakn.api.concept.concept import Concept.

Proposed Solution

We may well determine that the hybrid model is the right way to go - it was designed as a trade-off between conformance to Java and elegance in Python - but we should check, ideally with people with good Python experience.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions