apple / apple/foundationdb

Consider exporting commonly used Python classes from the main fdb module

Open
#4,231 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
16.7k
Forks
1.6k
Avg merge
1d 20h
Merged PRs (30d)
126

Description

I use lots of Type Annotations as formalized by [PEP 484](https://www.python.org/dev/peps/pep-0484/). They have been available since Python 3.5.

However, since the classes are only defined in sub-modules like `subspace_impl`, `directory_impl`, `impl`, `tuple`, etc, many of the annotations end up more verbose than necessary. For example:

```python
@fdb.transactional
def tr_delete(
tr: fdb.impl.Transaction, triple: BasicTriple, subspace: fdb.subspace_impl.Subspace
):
```

This is definitely a minor change, and could be worked around by writing `from fdb.impl import Transaction` or similar.

Contributor guide

Open the contributing guide

Research direction

Review the main fdb module alongside the referenced submodules: subspace_impl, directory_impl, impl, and tuple. Identify which commonly used classes should be available from fdb for shorter PEP 484 annotations, and check the existing Python API tests or import conventions. Done means the selected classes can be imported directly from fdb.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.