[
https://issues.apache.org/jira/browse/BEAM-7746?focusedWorklogId=336543&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-336543
]
ASF GitHub Bot logged work on BEAM-7746:
----------------------------------------
Author: ASF GitHub Bot
Created on: 30/Oct/19 23:58
Start Date: 30/Oct/19 23:58
Worklog Time Spent: 10m
Work Description: robertwb commented on issue #9056: [BEAM-7746] Add
python type hints
URL: https://github.com/apache/beam/pull/9056#issuecomment-548161213
> Yeah, it's a bit pedantic. By default mypy assigns `Any` to an unannotated
type, but in the case of `__init__` nothing would break or error if it were
omitted. However, it's good for people to get into the habit of fully
annotating their functions so that eventually we can reach complete coverage by
enabling `--disallow-untyped-defs`:
>
> ```
> --disallow-untyped-defs Disallow defining functions without type
> annotations or with incomplete type annotations
> (inverse: --allow-untyped-defs)
> ```
Hmm... Especially once we move to Python 3, writing the return type part of
`__init__(arg: str, arg2: iint) -> None` seems like we're crossing the point
from types being helpful to types being noise. One of the main points of
gradual typing is that they can be added *where useful* and omitted where not,
and I am firmly in the camp that unneeded symbols in your code are a net
negative. But possibly such calls are premature at this point.
----------------------------------------------------------------
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: 336543)
Time Spent: 16h 20m (was: 16h 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: 16h 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)