On Fri, Aug 7, 2020 at 11:48 PM David Mertz <me...@gnosis.cx> wrote:

> On Fri, Aug 7, 2020, 6:03 PM Paul Moore <p.f.mo...@gmail.com> wrote:
>
>> > x: int[0:]  # any ints greater than or equal to zero would match,
>> others would fail
>> > x: int[:101]  # any ints less than 101 match
>> > x: int[0:101:2]  # even less than 101
>>
>> I suspect the biggest issue with this is that it's likely to be
>> extremely hard (given the dynamic nature of Python) to check such type
>> assertions statically.
>
>
> Yes, it's hard in the sense that it would require solving the halting
> problem.
>

That doesn't sound so hard. ;)

Thanks for educating me. Could it at least be useful for:

1. Providing semantic meaning to code (but this is probably not enough
reason on its own)
2. Couldn't it still be useful for static analysis during runtime? Not in
cpython, but when the type hints are used in cython, for example?

---
Ricky.

"I've never met a Kentucky man who wasn't either thinking about going home
or actually going home." - Happy Chandler
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/RD2XX6S4MLPE7BGAFM4NN4NWOYPYYW2O/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to