RFC: Use type hints in larq source code
See original GitHub issueObjective
Python 3.6 and above supports type hints and optional statically typing of Python code. Since its introduction is has seen a lot of adoption in many Python projects in particular in larger code bases. Type hints are completely optional and are stripped by the Python parser before runtime.
I am not the only one @plumerai anymore who likes type hints for Python and we only support Python 3.6+ already so I’d like to discuss if we should introduce type hints to the larq
code base. I have never used typings in a big project, but below is a list of some pros and cons I can think of on top of my head.
Pros
- Makes it easy to reason about the code due to the self documenting nature of statically typed functions
- Helps with code review
- Can catch subtle bugs of in places of insufficient code coverage
- Has good integrations for editors that help with autocomplete and linting
Cons
- TensorFlow doesn’t use type hints so I don’t know how well type stubs are maintained
- Needs additional setup on CI and to maintain type stubs
- Might be confusing for novice Python users since it adds new syntax to the
larq
code base
Tooling
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Issues · larq/larq - GitHub
RFC : Use type hints in larq source code good first issue Good for newcomers internal-improvement Internal Improvements and Maintenance RFC - accepted ......
Read more >RFC 7594: A Framework for Large-Scale Measurement of ...
Several use cases have been proposed for large-scale measurements including: ... Data Model: The implementation of an Information Model in a particular data ......
Read more >Use of BGP for Routing in Large-Scale Data Centers RFC 7938
This document summarizes operational experience in designing and operating large-scale data centers using BGP as the only routing protocol.
Read more >ITU-T Rec. G.9954 (02/2005) Phoneline networking transceivers
Summary. This Recommendation defines the PHY, MAC, LINK and CONVERGENCE protocol stack layers for the G.9954 system providing the following features:.
Read more >tr-181-2-13-0-usp.xml
Redistribution and use in source and binary forms, with or without ... [RFC7398], RFC 7398, A Reference Path and Measurement Points for Large-Scale ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The most important thing is for the external API to have type hints so that this gets picked up in editors/IDEs; any private methods or tests don’t need them, and examples definitely don’t.
Just for reference TensorFlow Addons is also looking into introducting type checking: https://github.com/tensorflow/addons/issues/743