MagicStack / MagicStack/asyncpg

Type hints

Open
#387 1 comment 32 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
8.1k
Forks
468
PR merge metrics
No merged PRs in 30d

Description

Hi there!

I would really appreciate if the methods were defined with correct return data type as specified in [PEP-484](https://www.python.org/dev/peps/pep-0484/).

This would help with typing hints where the IDE can correctly determine how to help out with the right methods and variables.

Some examples on places I've stumbled into this:
- `create_ppol` should type hint `Pool`
- `Pool.acquire()` should type hint `Connection`
- `Connection.fetch()` should type hint `list of Record`
- `Connection.fetchrow()` should type hint `Record or None`

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 the definitions of create_ppol, Pool.acquire(), Connection.fetch(), and Connection.fetchrow(), then compare their return annotations with PEP 484. Done means the listed methods expose accurate return types, including Pool, Connection, list of Record, and Record or None.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, python
Domain
api, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.