You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed docstrings in the code that duplicate the "type hinting" feature of Python 3.5 and higher.
Below is an example of how type hinting can produce clean and easy-to-read code:
# current versiondefget_object(self, queryset=None):
""" Get page for specified language :param queryset: current queryset :type queryset: QuerySet :return: instance of Page :rtype: Page """# after using type hintingfromdjango.db.models.queryimportQuerySetfrom .modelsimportPagedefget_object(self, queryset=None: QuerySet) ->Page:
pass
Using type hinting also allows us to use static code analyzers which will help us produce less buggy code.
I noticed docstrings in the code that duplicate the "type hinting" feature of Python 3.5 and higher.
Below is an example of how type hinting can produce clean and easy-to-read code:
Using type hinting also allows us to use static code analyzers which will help us produce less buggy code.