Thankfully, style guidelines are based upon the limitations of humans like the size of the fovea and the general ability for people to follow long lines, NOT on the limitations of tools like grep.
On Tue, Feb 19, 2019 at 10:29 AM Anders Hovmöller <bo...@killingar.net> wrote: > > If it were me, I'd probably write (or would have re-written when I added > the type hints) that as follows: > > def resolve_annotations( > *, > raw_annotations: Dict[str, Type[Any]], > module_name: Optional[str] > ) -> Dict[str, Type[Any]]: > > > I would like to point out here that breaking up a line breaks grepping > quite badly. I've had to write AST-based searches to find simple usages of > arguments in the code base at work precisely because of code that is split > on likes like this. (This tool is available here: > https://github.com/boxed/parso_utils) > > I would vastly prefer a soft like break algorithm that formatted the code > as per your examples and having the code on disk be single line no matter > what. > > In proprietary projects where one can agree on the tools used for the code > this can be quite doable, but I agree it's not great for open source > projects. > > / Anders > _______________________________________________ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ >
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/