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

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

                Author: ASF GitHub Bot
            Created on: 30/Oct/19 17:22
            Start Date: 30/Oct/19 17:22
    Worklog Time Spent: 10m 
      Work Description: chadrik commented on issue #9056: [BEAM-7746] Add 
python type hints
URL: https://github.com/apache/beam/pull/9056#issuecomment-548019894
 
 
   Type annotations gained syntax support in 2 passes:  function annotations
   in 3.5 and variable annotations in 3.6.  So yes, once we get to python 3.6
   there will no longer be a need for type comments.  Luckly, there is a tool
   for automatically converting comments to annotations.
   
   On Wed, Oct 30, 2019 at 9:41 AM Alex Amato <[email protected]> wrote:
   
   > *@ajamato* commented on this pull request.
   > ------------------------------
   >
   > In sdks/python/apache_beam/typehints/decorators.py
   > <https://github.com/apache/beam/pull/9056#discussion_r340731259>:
   >
   > > @@ -193,7 +200,7 @@ def __repr__(self):
   >          self.input_types, self.output_types)
   >
   >
   > -class WithTypeHints(object):
   > +class WithTypeHints(Generic[InT, OutT]):
   >
   > Python3.6+ has some built in support for static typing, if I understand
   > correctly.
   >
   >
   > 
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.
   >
   > —
   > You are receiving this because you were mentioned.
   > Reply to this email directly, view it on GitHub
   > 
<https://github.com/apache/beam/pull/9056?email_source=notifications&email_token=AAAPOEZFON75VJKN436T3CDQRG2KNA5CNFSM4ICSQA7KYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCJYF7ZI#discussion_r340731259>,
   > or unsubscribe
   > 
<https://github.com/notifications/unsubscribe-auth/AAAPOEZ7ZAKTPQTWFM2VSDDQRG2KNANCNFSM4ICSQA7A>
   > .
   >
   
 
----------------------------------------------------------------
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: 336315)
    Time Spent: 13h 20m  (was: 13h 10m)

> 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 20m
>  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