Re: [Python-Dev] What should a good type checker do? (was: Please reject or postpone PEP 526)

2016-09-03 Thread Koos Zevenhoven
What's up with the weird subthreads, Stephen?! On Guido's suggestion, I'm working on posting those type-checking thoughts here. -- Koos On Sat, Sep 3, 2016 at 6:17 PM, Stephen J. Turnbull wrote: > Please respect Reply-To, set to python-ideas. > > Greg Ewing

Re: [Python-Dev] What should a good type checker do? (was: Please reject or postpone PEP 526)

2016-09-03 Thread Stephen J. Turnbull
Please respect Reply-To, set to python-ideas. Greg Ewing writes: > Chris Angelico wrote: > > Forcing people to write 1.0 just to be compatible with 1.5 will cause > > a lot of annoyance. > > Indeed, this would be unacceptable IMO. But "forcing" won't happen. Just ignore the warning.

Re: [Python-Dev] What should a good type checker do? (was: Please reject or postpone PEP 526)

2016-09-02 Thread Greg Ewing
Chris Angelico wrote: Forcing people to write 1.0 just to be compatible with 1.5 will cause a lot of annoyance. Indeed, this would be unacceptable IMO. The checker could have a type 'smallint' that it considers promotable to float. But that wouldn't avoid the problem entirely, because e.g.

Re: [Python-Dev] What should a good type checker do? (was: Please reject or postpone PEP 526)

2016-09-02 Thread Random832
On Fri, Sep 2, 2016, at 18:49, Koos Zevenhoven wrote: > Then again, (b) instead of that being working code, it might be an > error and spam only takes float. No problem, the type checker will > catch that. There are very few functions that should only take float and not int. > On Fri, Sep 2,

Re: [Python-Dev] What should a good type checker do? (was: Please reject or postpone PEP 526)

2016-09-02 Thread Guido van Rossum
Won't you ll agree that this thread belongs on python-ideas? -- --Guido van Rossum (python.org/~guido) ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] What should a good type checker do? (was: Please reject or postpone PEP 526)

2016-09-02 Thread Chris Angelico
On Sat, Sep 3, 2016 at 8:49 AM, Koos Zevenhoven wrote: > On Fri, Sep 2, 2016 at 9:04 PM, Steven D'Aprano wrote: >> On Fri, Sep 02, 2016 at 08:10:24PM +0300, Koos Zevenhoven wrote: >> >>> A good checker should be able to infer that x is a union type at the

[Python-Dev] What should a good type checker do? (was: Please reject or postpone PEP 526)

2016-09-02 Thread Koos Zevenhoven
On Fri, Sep 2, 2016 at 9:04 PM, Steven D'Aprano wrote: > On Fri, Sep 02, 2016 at 08:10:24PM +0300, Koos Zevenhoven wrote: > >> A good checker should be able to infer that x is a union type at the >> point that it's passed to spam, even without the type annotation. For >>