Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[propose] Should we have event caller (f_back) in type_comments?

Open
#115 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
tooling

Research direction

Start with pyannotate_runtime/collect_types.py at lines 446-448, then inspect the related FunctionKey changes mentioned in the issue. Compare the current type_comments structure with the proposed caller-to-type mapping and determine whether the added caller context is consistent and acceptable for the collected samples. Done means the proposal has a decided design and an identified implementation scope.

Written by the indexing model from the issue text.

Description

If you have multiple functions calling one function, it will look like this.

  {
    "path": "~~~",
    "line": 1,
    "func_name": "called_func",
    "type_comments": [
        "(int) -> int"
        "(int) -> str"
    ],
    "samples": 2
  },

I would like to know which function calls the called_func in this case.

  {
    "path": "~~~",
    "line": 1,
    "func_name": "called_func",
    "type_comments": [
        {
            "calling1_func": "(int) -> int",
        }
        {
            "calling2_func": "(int) -> str",
        }
    ],
    "samples": 2
  },

... because there are chances to have 10 or more samples (sadly).

remarks

This must change the code below (and more. such as FunctionKey), but it maybe gets slower.

https://github.com/dropbox/pyannotate/blob/1e7ddf09fdbc6fa37b2cf261f36a5563a0fe772a/pyannotate_runtime/collect_types.py#L446-L448

So I want to know if this proposal is ideal or not. If ideal I think I can contribute when I have a time (maybe late of this month)

Dominant language
Python
Stars
1.4k
Forks
59
PR merge metrics
No merged PRs in 30d

Getting set up

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.

More from dropbox/pyannotate

All issues in dropbox/pyannotate

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.