« first day (4932 days earlier)      last day (34 days later) » 
07:00 - 13:0015:00 - 21:00

7:33 AM
@Aran-Fey Hm, technically it does violate the specification indeed: "Final names cannot be reassigned in any scope." So the first assignment should be safe, even if it happens after the annotation.
FWIW, mypy also doesn't like it but directly complains that the value is unassigned: error: Final name must be initialized with a value [misc] and error: Cannot assign to final name "host" [misc]
 
8:06 AM
@matszwecja Using mypy it will also report that 2: error: Final name must be initialized with a value [misc]
Moreover, the documentation states that "Final names cannot be reassigned in any scope"
derp, I was scrolled up a bit
 
 
2 hours later…
9:47 AM
@MisterMiyagi the thing is it does work for a single assignment (host = "localhost") but with unpacking assignment its always considered as reassignment even if it's first time you are assigning something to that name.
 
I feel your pain. Just realised PyRight happily ignores attributes annotated literally as type.
from typing import Protocol

class Foo(Protocol):
    bar: type

def lol(foo: Foo) -> type:
    return foo.bar  # "Type of "bar" is unknown"
 
Wow, wonder how the heck that happens
 
This "unknown" stuff is super annoying.
Type "(a: Unknown, b: Unknown, *others: Unknown) -> float" cannot be assigned to type "(*args: Any, **kwargs: Any) -> float"
partially typed code is hell. :/
 
pyright really likes its Unknowns lately. Sometimes it just adds a | Unknown to a type for no apparent reason
 
 
3 hours later…
12:42 PM
@Aran-Fey congrats on your new project (rio) looks good :)
@Peilonrayz never knew that. Weird given that's the one tag that would be fine if it was on all questions, since most people just make implementation from scratch for various reasons.
@roganjosh I always made my own counter implementation before knowing about Counter but I never thought it was anything special :o
 
@NordineLotfi Thanks. It's kind of a mess still, but we're getting there...
 
07:00 - 13:0015:00 - 21:00

« first day (4932 days earlier)      last day (34 days later) »