On Sun, Sep 4, 2016 at 2:33 AM, Koos Zevenhoven wrote:
> On Sun, Sep 4, 2016 at 2:22 AM, Chris Angelico wrote:
>> On Sun, Sep 4, 2016 at 7:44 AM, Koos Zevenhoven wrote:
I wonder if it would be different if you wrote that as a single expression:
x = 1 if cond else 1.5
x =
On Sun, Sep 4, 2016 at 4:20 AM, Steven D'Aprano wrote:
> On Sun, Sep 04, 2016 at 12:26:58AM +0300, Koos Zevenhoven wrote:
>> On Friday, while replying to a post on python-dev about PEP 526
>> (variable annotations), I ended up mentioning things that I think a
>> good type checker should do, which
On Sun, Sep 04, 2016 at 12:26:58AM +0300, Koos Zevenhoven wrote:
> On Friday, while replying to a post on python-dev about PEP 526
> (variable annotations), I ended up mentioning things that I think a
> good type checker should do, which seem to differ from the general
> understanding. The discussi
On Sun, Sep 4, 2016 at 2:22 AM, Chris Angelico wrote:
> On Sun, Sep 4, 2016 at 7:44 AM, Koos Zevenhoven wrote:
>>> I wonder if it would be different if you wrote that as a single expression:
>>>
>>> x = 1 if cond else 1.5
>>>
>>> x = sum([1] + [0.5] * cond)
>>>
>>> What should type inference deci
On Sun, Sep 4, 2016 at 7:44 AM, Koos Zevenhoven wrote:
>> I wonder if it would be different if you wrote that as a single expression:
>>
>> x = 1 if cond else 1.5
>>
>> x = sum([1] + [0.5] * cond)
>>
>> What should type inference decide x is in these cases? Assume an
>> arbitrarily smart type chec
Below I respond to Chris Angelico's post in the python-dev thread.
On Sat, Sep 3, 2016 at 2:01 AM, Chris Angelico wrote:
def eggs(cond:bool):
if cond:
x = 1
else:
x = 1.5
spam(x) # a good type checker infers that x is of type Union[
On Friday, while replying to a post on python-dev about PEP 526
(variable annotations), I ended up mentioning things that I think a
good type checker should do, which seem to differ from the general
understanding. The discussion should continue here, though, because
the aim of PEP 526 is not to def