[Python-ideas] Optional static typing -- late to the party
Bob Ippolito
bob at redivi.com
Wed Aug 20 20:14:31 CEST 2014
There's the misunderstanding: PyContracts style contracts are not "easy
enough" in Haskell.
mypy's types are not like a C type system. There are a few missing features
that are being worked on, but it is much better than some here perceive it
to be.
On Wednesday, August 20, 2014, David Mertz <mertz at gnosis.cx> wrote:
> Hi Bob,
>
> I enjoyed watching your talk (on video, not live), and I certainly see the
> appeal of a Haskell-like type system. However, what we seem to be
> discussing here with mypy annotations looks a lot closer to a C type system
> than to a Haskell type system. All those things that PyContracts get us
> are easy enough in Haskell--why aim so low if we are thinking of a change
> in Python?
>
>
> On Wed, Aug 20, 2014 at 10:42 AM, Bob Ippolito <bob at redivi.com
> <javascript:_e(%7B%7D,'cvml','bob at redivi.com');>> wrote:
>
>> On Wed, Aug 20, 2014 at 10:23 AM, David Mertz <mertz at gnosis.cx
>> <javascript:_e(%7B%7D,'cvml','mertz at gnosis.cx');>> wrote:
>>
>>> I have to say that I find the capabilities in PyContracts--which are
>>> absent currently in mypy--to be very compelling. If we are going to add
>>> encouragement to use type annotations, adding richer types seems extremely
>>> worthwhile.
>>>
>>
>> It's easy to check any expressible condition at runtime, but this is not
>> the case ahead of time as with a static analysis tool or linter. It'd be
>> great to have this sort of capability in mypy, but what you're asking for
>> is at the fringes of current research and will not be practical to add to
>> Python any time soon.
>>
>> -bob
>>
>>
>
>
> --
> Keeping medicines from the bloodstreams of the sick; food
> from the bellies of the hungry; books from the hands of the
> uneducated; technology from the underdeveloped; and putting
> advocates of freedom in prisons. Intellectual property is
> to the 21st century what the slave trade was to the 16th.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140820/a13ce0ec/attachment.html>
More information about the Python-ideas
mailing list