Re: Type Hints for Python!

2020-08-20 Thread Driesprong, Fokko
Cool stuff Michael,

I'll pick up some files and start adding type-hints :)

Cheers, Fokko

Op ma 17 aug. 2020 om 14:40 schreef Michael A. Smith :

> We've had mypy, the Python type checker, running in Travis-CI on
> lang/py for a little while. However, mypy doesn't actually check code
> unless it has type hints, so it has been doing very little. Now that
> we are only supporting Python 3.5 and up, we can add real type hints!
>
> I'm excited about this, because I think it will really improve the
> Python implementation. There are a fair amount of Liskov violations
> and other places where type theory rules have been bent or broken in
> the Python implementation, so there will be places where we need to
> decide if we want to make an API breaking change, or ignore an
> inconsistency.
>
> If you want to see what mypy is able to check right now, you can
> install mypy and lxml and run mypy --html-report mypy-html and open
> mypy-html/index.html in your browser.
>
> If you can find the time to open a PR against AVRO-2921 and introduce
> type hints in a single module or test, please give it a shot. If the
> type checker finds a bug as a result, please report the bug.
>
> Happy Hinting!
>


Type Hints for Python!

2020-08-17 Thread Michael A. Smith
We've had mypy, the Python type checker, running in Travis-CI on
lang/py for a little while. However, mypy doesn't actually check code
unless it has type hints, so it has been doing very little. Now that
we are only supporting Python 3.5 and up, we can add real type hints!

I'm excited about this, because I think it will really improve the
Python implementation. There are a fair amount of Liskov violations
and other places where type theory rules have been bent or broken in
the Python implementation, so there will be places where we need to
decide if we want to make an API breaking change, or ignore an
inconsistency.

If you want to see what mypy is able to check right now, you can
install mypy and lxml and run mypy --html-report mypy-html and open
mypy-html/index.html in your browser.

If you can find the time to open a PR against AVRO-2921 and introduce
type hints in a single module or test, please give it a shot. If the
type checker finds a bug as a result, please report the bug.

Happy Hinting!


[jira] [Commented] (AVRO-2387) Type Hints for Python 3.5+

2020-02-07 Thread Jira


[ 
https://issues.apache.org/jira/browse/AVRO-2387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17032243#comment-17032243
 ] 

Ismaël Mejía commented on AVRO-2387:


+1000

> Type Hints for Python 3.5+
> --
>
> Key: AVRO-2387
> URL: https://issues.apache.org/jira/browse/AVRO-2387
> Project: Apache Avro
>  Issue Type: Improvement
>Affects Versions: 1.9.0
>Reporter: Michael A. Smith
>Assignee: Michael A. Smith
>Priority: Major
> Fix For: 1.10.0
>
>
> I propose to add type hints to the py3 library. I'd like to find an iterative 
> way to do it, otherwise this will be a significant undertaking. So I propose:
>  # Add type hints after 1.9.0 gets released, while dropping support for 
> python 3.4.
>  # Add mypy support to TravisCI or Yetus, so that future maintainers are 
> warned when introducing type check failures.
>  # Fix the type check failures, which may require some refactoring and 
> discussion.



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


[jira] [Assigned] (AVRO-2387) Type Hints for Python 3.5+

2019-05-07 Thread Fokko Driesprong (JIRA)


 [ 
https://issues.apache.org/jira/browse/AVRO-2387?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Fokko Driesprong reassigned AVRO-2387:
--

Assignee: Michael A. Smith

> Type Hints for Python 3.5+
> --
>
> Key: AVRO-2387
> URL: https://issues.apache.org/jira/browse/AVRO-2387
> Project: Apache Avro
>  Issue Type: Improvement
>Affects Versions: 1.9.0
>Reporter: Michael A. Smith
>Assignee: Michael A. Smith
>Priority: Major
> Fix For: 1.10.0
>
>
> I propose to add type hints to the py3 library. I'd like to find an iterative 
> way to do it, otherwise this will be a significant undertaking. So I propose:
>  # Add type hints after 1.9.0 gets released, while dropping support for 
> python 3.4.
>  # Add mypy support to TravisCI or Yetus, so that future maintainers are 
> warned when introducing type check failures.
>  # Fix the type check failures, which may require some refactoring and 
> discussion.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (AVRO-2387) Type Hints for Python 3.5+

2019-05-07 Thread Fokko Driesprong (JIRA)


 [ 
https://issues.apache.org/jira/browse/AVRO-2387?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Fokko Driesprong updated AVRO-2387:
---
Affects Version/s: 1.9.0

> Type Hints for Python 3.5+
> --
>
> Key: AVRO-2387
> URL: https://issues.apache.org/jira/browse/AVRO-2387
> Project: Apache Avro
>  Issue Type: Improvement
>Affects Versions: 1.9.0
>Reporter: Michael A. Smith
>Priority: Major
> Fix For: 1.10.0
>
>
> I propose to add type hints to the py3 library. I'd like to find an iterative 
> way to do it, otherwise this will be a significant undertaking. So I propose:
>  # Add type hints after 1.9.0 gets released, while dropping support for 
> python 3.4.
>  # Add mypy support to TravisCI or Yetus, so that future maintainers are 
> warned when introducing type check failures.
>  # Fix the type check failures, which may require some refactoring and 
> discussion.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (AVRO-2387) Type Hints for Python 3.5+

2019-05-07 Thread Fokko Driesprong (JIRA)


 [ 
https://issues.apache.org/jira/browse/AVRO-2387?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Fokko Driesprong updated AVRO-2387:
---
Fix Version/s: 1.10.0

> Type Hints for Python 3.5+
> --
>
> Key: AVRO-2387
> URL: https://issues.apache.org/jira/browse/AVRO-2387
> Project: Apache Avro
>  Issue Type: Improvement
>Reporter: Michael A. Smith
>Priority: Major
> Fix For: 1.10.0
>
>
> I propose to add type hints to the py3 library. I'd like to find an iterative 
> way to do it, otherwise this will be a significant undertaking. So I propose:
>  # Add type hints after 1.9.0 gets released, while dropping support for 
> python 3.4.
>  # Add mypy support to TravisCI or Yetus, so that future maintainers are 
> warned when introducing type check failures.
>  # Fix the type check failures, which may require some refactoring and 
> discussion.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (AVRO-2387) Type Hints for Python 3.5+

2019-05-04 Thread Michael A. Smith (JIRA)
Michael A. Smith created AVRO-2387:
--

 Summary: Type Hints for Python 3.5+
 Key: AVRO-2387
 URL: https://issues.apache.org/jira/browse/AVRO-2387
 Project: Apache Avro
  Issue Type: Improvement
Reporter: Michael A. Smith


I propose to add type hints to the py3 library. I'd like to find an iterative 
way to do it, otherwise this will be a significant undertaking. So I propose:
 # Add type hints after 1.9.0 gets released, while dropping support for python 
3.4.
 # Add mypy support to TravisCI or Yetus, so that future maintainers are warned 
when introducing type check failures.
 # Fix the type check failures, which may require some refactoring and 
discussion.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)