Comments (4)
This is a good catch! At this point, I'd suggest making a research to see if there is any practical ways of actually conducting runtime checks for argument types.
I have spent some time looking into this, and the Python developers have made it clear that they don't ever want to enforce typing. Doing so would remove the benefits of Python being dynamically typed (i.e. the flexibility of duck-typing).
I think the easiest way to enforce specific types for our functions would be to check the argument types at the start of the function and return reasonable error messages. This would be a courtesy to our users, and by no means is it currently required. However, it isn't a bad idea to do. My motivation for looking in to type hints was to avoid cryptic error messages when a function fails, and this alternative would accomplish that with a bit more code. I'm open to discussion about it.
Also, I think @anissa111 had some thoughts about type hints would change with a future Python version?
@anissa111 pointed out to me that there are some changes to how type hints are formatted in Python 10, but it appears to be backwards compatible syntax changes. See PEP 604 for more details.
from geocat.
I now realize that I misunderstood how Python uses type hints. They do not impact anything at runtime like I once thought, but they are used by IDE's to help the developer. For instance, when a function is created with type hints and it is used elsewhere in the same file, PyCharm creates this handy popup for each argument with its associated type. I'm unsure how other IDEs and linters utilize type hints, but this can still be useful to have.
For more info on typing in Python https://docs.python.org/3/library/typing.html#
from geocat.
This is a good catch! At this point, I'd suggest making a research to see if there is any practical ways of actually conducting runtime checks for argument types. If there is not, then forcing type hints may be discussed again, taking its limited help into account. Also, I think @anissa111 had some thoughts about type hints would change with a future Python version?
from geocat.
In our team meeting yesterday, we decided to not require type hints, and our stance on them is neutral. Because types are already listed in the required doc strings for each function, the addition of type hints would not add any information to our software. In addition, type hints do not have any influence at runtime and cannot throw errors when incorrect types are passed in. However, we recognize that they can be useful for developers using certain IDE's and type checkers. It is up to individual contributor's discretion whether or not to include type hints.
from geocat.
Related Issues (20)
- GeoCAT webpage Documentation Tab Update
- geocat.comp.rcm2points error: axes don't match array HOT 4
- Errors in creating new environment on remote server HOT 3
- module geocat.comp has no attribute rgrid2rcm HOT 3
- Clarification request for GeoCAT installation documentation HOT 10
- Refresh content on landing page HOT 1
- Update GeoCAT installation instructions HOT 1
- Announce the decision of dropping NCAR channel releases in homepage
- Announce GeoCAt tutorial on webpage
- Lead the GeoCAT tutorial organization
- GeoCAT homepage video lost HOT 4
- xlim issue when crossing the dateline HOT 2
- Update Contributors' Guide
- Add a web accessibility link HOT 3
- Update to comply with the New NSF Branding Theme
- GeoCAT video on the homepage is out of date
- Highlight gallery content and other resources
- Merge documentation and software pages?
- Remove 2023 roadmap from the website
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geocat.