Replies: 1 comment
-
Converting this into a discussion as I think the standards are being followed in the code base. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We all know the python is slick in handling types, for instance we can create a function called
and this function can take in any data type and print it ( even functions as functions are first class objects in python ). So this can be disastrous for us who are designing the framework as this can lead to issues when somebody invokes and uses the function
in a way which isn't intended. The question is, do we have a salvation ?
Yes,
PEP-3107 : https://www.python.org/dev/peps/pep-3107/
The very least we can do is annotate the parameters so that it is seen in the function definitions when the user if going through them. If anyone uses IDEs, these annotations would help in correcting a user if they're going to commit a mistake in the type of data they're going to pass.
The relog module already uses function annotations, and can be used as a reference for further changes across the framework.
Beta Was this translation helpful? Give feedback.
All reactions