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

Analyze lists of objects #1

Open
mrapacz opened this issue Mar 29, 2020 · 1 comment
Open

Analyze lists of objects #1

mrapacz opened this issue Mar 29, 2020 · 1 comment
Labels
enhancement New feature or request
Projects

Comments

@mrapacz
Copy link
Owner

mrapacz commented Mar 29, 2020

We could also generate the namedtuple definitions from lists of objects. This should allow for better calibration of inferred types (e.g. if some attributes are sometimes None, sometimes int, the generator should infer the type Optional[int])

@mrapacz mrapacz added the enhancement New feature or request label Mar 29, 2020
@mrapacz mrapacz added this to To do in ntgen via automation Mar 29, 2020
@mrapacz
Copy link
Owner Author

mrapacz commented Apr 5, 2020

We can use TentativeType for this https://github.com/dropbox/pyannotate/blob/master/pyannotate_runtime/collect_types.py#L293
Instead of regular InternalType instances, we'll need to keep a list of TentativeTypes for each attribute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
ntgen
  
To do
Development

No branches or pull requests

1 participant