[ 
https://issues.apache.org/jira/browse/BEAM-7746?focusedWorklogId=336276&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-336276
 ]

ASF GitHub Bot logged work on BEAM-7746:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 30/Oct/19 16:41
            Start Date: 30/Oct/19 16:41
    Worklog Time Spent: 10m 
      Work Description: ajamato commented on pull request #9056: [BEAM-7746] 
Add python type hints
URL: https://github.com/apache/beam/pull/9056#discussion_r340731259
 
 

 ##########
 File path: sdks/python/apache_beam/typehints/decorators.py
 ##########
 @@ -193,7 +200,7 @@ def __repr__(self):
         self.input_types, self.output_types)
 
 
-class WithTypeHints(object):
+class WithTypeHints(Generic[InT, OutT]):
 
 Review comment:
   Python3.6+ has some built in support for static typing, if I understand 
correctly. (Not sure if you were referring to this above.)
   
   
https://medium.com/@ageitgey/learn-how-to-use-static-type-checking-in-python-3-6-in-10-minutes-12c86d72677b
   
   If we get beam onto python3 only, would it make more sense to use that 
instead of this comment style type hints? I was curious if there was an 
advantage to using the comment hints, other than the python2 support.
   
   Don't get me wrong, I think this change will be quite helpful and should 
proceed. But it could be a good stepping stone to the later python3 static 
typing, as it will be much easier to implement given your initial type hints.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 336276)
    Time Spent: 13h  (was: 12h 50m)

> Add type hints to python code
> -----------------------------
>
>                 Key: BEAM-7746
>                 URL: https://issues.apache.org/jira/browse/BEAM-7746
>             Project: Beam
>          Issue Type: New Feature
>          Components: sdk-py-core
>            Reporter: Chad Dombrova
>            Assignee: Chad Dombrova
>            Priority: Major
>          Time Spent: 13h
>  Remaining Estimate: 0h
>
> As a developer of the beam source code, I would like the code to use pep484 
> type hints so that I can clearly see what types are required, get completion 
> in my IDE, and enforce code correctness via a static analyzer like mypy.
> This may be considered a precursor to BEAM-7060
> Work has been started here:  [https://github.com/apache/beam/pull/9056]
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to