Open bernt-matthias opened 4 years ago
This seems like a reasonable approach. I do have some feedback, however.
Out of interest, what is an example of this PR improving behaviour? I would have though your example in #37 would predict None
, then CliFile()
then CliFile()
respectively, and then return CliFile()
. We only use subclasses for CliFileSystemType
, and only recently, but the inference will never return CliFileSystemType
, so it seems irrelevant.
If I ever rewrite my type system (and the representable
property), I might be able to make this work better.
Could you please add a test case also please. You should be able to use the exact example from the linked issue.
Can try. Do you have an example how this is done? Or where?
Ah well eventually I'll make a test_data_model.py
or something, but in the meantime I think you could chuck this into test_type_inference.py
. You can construct a Flag()
object with the fields that you mentioned in #37, and then assert that the value of Flag.get_type()
returns the right value.
Also look into getting pre-commit
set-up so that the builds pass, and the git diffs are easier for me to read. You should just have to run:
pip install pre-commit
pre-commit install
by checking for subclasses