zero323 commented on pull request #29180: URL: https://github.com/apache/spark/pull/29180#issuecomment-663558139
> > For example, Python type hinting is optional and still premature. > > This is definitely not true anymore with Python 3.6. You could say this with Python <=3.5, but it has evolved quite well over time. I am not sure if I can fully agree here. Hints are more than Python version, and parts of the ecosystem evolve faster than Python itself. For example, with pyspark-stubs I had to make significant adjustments > I haven't seen any project that got worse by having type-hints. That's probably true, but not every project can actually benefit from hints (though that's not the case here). > @HyukjinKwon : we have the types along with the code in Scala and Java. I think having the types along side the code makes it easier to remember to update them and gives hints while someones reading the code. I think it is more about good workflow than anything else. That being said I think we should keep in mind that type hints don't serve the same purpose as type in statically typed languages and certain constructs (like already mention structural sub-typing) can mean that we have no actual code to annotate (you can check all the `_typing` modules in `pyspark-stubs` for examples). Additionally certain parts of the API might require [somewhat ugly strategies](https://github.com/zero323/pyspark-stubs/blob/master/third_party/3/pyspark/sql/pandas/_typing/__init__.pyi) to get something useful in daily practice. > Sounds good to me. I'm in favor of having it inline, but having the annotation in the pyi is a good first step :) In-lining can be mostly automated (though AFAIK no tool at the moment support inlining of `overloaded` signatures. Speaking about stability of ecosystem). ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
