Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ghost opened this issue Jun 6, 2021 · 0 comments
Open

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

ghost opened this issue Jun 6, 2021 · 0 comments

Comments

@ghost
Copy link

ghost commented Jun 6, 2021

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.

# TODO: Make this faster
def get_function_name_from_frame(frame):
# type: (Any) -> str

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants