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

Bout comparison function #8

Open
Asonin opened this issue May 15, 2021 · 1 comment
Open

Bout comparison function #8

Asonin opened this issue May 15, 2021 · 1 comment

Comments

@Asonin
Copy link

Asonin commented May 15, 2021

Hi, we are students from PKU, CN, we are now reading your projects and trying 2 understand how it works, but we got a bit of problems to fix right now.
1.We ran you code with test case 4. while case 4 has only one argument input, it generates pairs of possible type choices. Suppose arguments and types of arguments are strictly paired, how do you compare a pair of type choices and what does the other type choice in the pair refers to?

e.g. (_no, [<class 'str'>,<class 'int'>])

@agb94
Copy link
Owner

agb94 commented May 16, 2021

Hi, thanks for your question about Wakanda :)

When I put this after line 54 in the main.py file:

    for types in type_candidates:
        print(types, f"length: {len(types)}, types[0]: {types[0]}")

python main.py python-functions/case4.py case4 produced the following output:

INPUT GENERATOR for python-functions/case4.py
Start type search.......
[<covgen.type._type object at 0x1043caad0>] length: 1, types[0]: bool
[<covgen.type._type object at 0x1043c9f10>] length: 1, types[0]: int
[<covgen.type._type object at 0x1043ca8d0>] length: 1, types[0]: str
[<covgen.type._type object at 0x1043ba350>] length: 1, types[0]: tuple
[<covgen.type._type object at 0x1043bacd0>] length: 1, types[0]: list
[<covgen.type._type object at 0x1043c9ed0>] length: 1, types[0]: float
6 type candidates found.

Start value search......
1/4 branches have been covered while searching types.
4/4 branches have been covered.

RESULT
1T: (0.0,)
1F: ('Hello',)
2T: ('Hello',)
2F: ('HelloJ',)
Done.
============================================

It seems like we got 6 possible type candidates for case 4, each of which contains only the type inference for the single argument (bool, int, ...).
I was trying to understand what the pairs mean in your question, but I, unfortunately, couldn't figure it out.
Can you give me some hint to reproduce it?

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

2 participants