tarantool / tarantool/tarantool-python

Type hints and type check

Open
#266 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

2sp code health needs feedback
Dominant language
Python
Stars
108
Forks
51
Avg merge
1d 8h
Merged PRs (30d)
1

Description

Type hints is a modern Python way to provide type information (see typing mypy). PR https://github.com/tarantool/tarantool-python/pull/264 is the first one to potentially use type hints, but it would be nice to have it anywhere.

Type asserts is a more tricky question. For now there are some minor type checks and asserts in connector. Some may also be implemented in PR #264. But it is a big question if they should be use. It seems that there are both adepts of using (since it is a convenient concept) and forbidding to use (since it contradicts Python duck typing principle) it. For example, see this StackOverflow thread. One way or another, it would be good to at least have a consistency on this question.

Since now package is fully documented, it should be easy to implement type hints and asserts after one decide what approach we should stick to. But choosing the approach is the question.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading PR #264 and the existing connector type checks and asserts, then review the package documentation and the linked typing and mypy references. The issue first needs a decision on whether to add type hints and how consistently to use runtime type checks or asserts; done means that agreed approach is applied across the package.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.