Closed kornicameister closed 3 years ago
@TkTech that is very basic idea for the 1st round of discussions :))
@TkTech consider this patch a WIP. I need to deal with some issues around __getitem__
in Array
. I will push the changes as soon as I have time to do them.
Looking good, added a few comments, but I'm not super familiar with mypy.
@TkTech that's why I am constantly checking how those typings perform against my own codebase.
One thing that grabbed my attention was that in fact we can define neither Object
nor Array
as generic type. Such definition makes mypy
complain that we either of those misses type.
I don't think that's the case with pysimdjson
to say Object[str]
or Array[Union[str, int]]
, right?
FYI: a little of typings in action:
@TkTech out of pure curiosity? Should I expect another review round, merging this one up or will it wait for you being ready to proceed with cythonize branch? I am fine either way :D just curious :)
Just waiting for v4 (the cythonize branch) to get finished, API isn't 100% stable yet but it's pretty close.
How are you testing these typings? It would be nice to have mypy run them in the test workflow.
Actually, that is a very good point. I will write some of those. I haven't checked your framework of choice but if that is pytest
it shouldn't be big of a deal.
@TkTech tests added, your GHA config does not pick my fork so there's no confirmation visible. Let me paste a screen in that case.
Awesome! Sorry there hasn't been movement on this, just been a bit too busy to finish up v4.
This is included in 4.0.0, with a couple corrections. Unfortunately I removed the tests, they were far more of a pain (why, why does it include line numbers in the output!) then they're worth at the moment. I plan to revisit the testing for this.
@TkTech as far as I remember there is/was a possibility to turn off line numbers from mypy output. If you will have any issues you can always drop me an issue on repository. I might be able to take a look.
Closes: #75