whitequark[cis] changed the topic of #amaranth-lang to: Amaranth hardware definition language · weekly meetings: Amaranth each Mon 1700 UTC, Amaranth SoC each Fri 1700 UTC · play https://amaranth-lang.org/play/ · code https://github.com/amaranth-lang · logs https://libera.irclog.whitequark.org/amaranth-lang · Matrix #amaranth-lang:matrix.org
<whitequark[cis]> Wanda: oh, neat: https://docs.python.org/3/library/operator.html#operator.attrgetter
<RobTaylor[m]> Catherine: this seems to work..... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/PBqPHoGgTdhcWpgKAtXwvelw>)
<RobTaylor[m]> now that itch has gone i can sleep >< =)
<whitequark[cis]> that's not a valid annotation
<RobTaylor[m]> It is according to pyright
<whitequark[cis]> only Unsigned[Literal[1]] is valid
<whitequark[cis]> hmm
<whitequark[cis]> mypy will yell at you for Unsigned[1]
<whitequark[cis]> now, am I potentially open to adding annotations that exclusively work with pyright? maybe, I'd need to see an RFC proposing it comprehensively
<whitequark[cis]> is going from "illegal according to Python annotations" to "illegal according to Python annotations but different" an improvement? I don't know
<RobTaylor[m]> Hmm, If i'm reading the python type spec correctly, generic subscripting just must 'confirm to normal subscripting rules'
<whitequark[cis]> there's two parts to it: one run-time (where __class_getitem__ gets actually called) and one typechecking-time
<whitequark[cis]> the latter is matched against the grammar in the docs, with pyright being more lax about it
<RobTaylor[m]> yeah, i'm unsure, nontypes in generics is something useful, and doesnt seem to be explictly banned, and only implicitly supported via Literal. I guess it's a case of asking
<whitequark[cis]> it's explicitly banned in the link I've given above
<whitequark[cis]> the grammar is unambiguous in that it doesn't allow nontypes in subscripts
<RobTaylor[m]> ah, yeah i see, missed that
FFY00 has quit [Remote host closed the connection]
FFY00_ has joined #amaranth-lang
jn has quit [Ping timeout: 252 seconds]
jn has joined #amaranth-lang
jn has joined #amaranth-lang
jn has quit [Changing host]
Degi_ has joined #amaranth-lang
Degi has quit [Ping timeout: 255 seconds]
Degi_ is now known as Degi
Stary has quit [Quit: ZNC - http://znc.in]
Stary has joined #amaranth-lang
<Wanda[cis]> <whitequark[cis]> "the grammar is unambiguous in..." <- <del>I mean, `typenum` already solved that problem</del>
toshywoshy has quit [Read error: Connection reset by peer]
toshywoshy has joined #amaranth-lang
Chips4MakersakaS has joined #amaranth-lang
<Chips4MakersakaS> <whitequark[cis]> "ultimately i feel like python..." <- I am a one man company so I don't consider my dev environment a corporate place :)
<Chips4MakersakaS> I do like static typing in the IDE. I personally feel this is more productive than the run-time type checking Amaranth provides.
<whitequark[cis]> the run-time typechecking isn't there to improve productivity in and of itself; it's there to make sure nobody ever ends up in a situation where they're getting some error that's probably caused by types, but they don't understand why because it happens deep in Amaranth guts
<whitequark[cis]> it's kind of a last resort thing or a backstop that covers everyone using Amaranth in any environment no matter who they are
<whitequark[cis]> (of course, not chasing type errors in Amaranth guts does improve productivity, but that's a secondary effect to reducing frustration of newcomers)
mindw0rk has quit [Ping timeout: 252 seconds]
mindw0rk has joined #amaranth-lang
mindw0rk has quit [Ping timeout: 276 seconds]
mindw0rk has joined #amaranth-lang
jn has quit []
jn has joined #amaranth-lang
jn has joined #amaranth-lang
jn has quit [Changing host]
<RobTaylor[m]> Catherine: i hacked up a patch last night to allow the use of Annotated[] in data.Flow members, for those users who wish to have full type checking available for their codebase. Would it be of interest if I finish that up properly, and would that require an RFC? Thanks!... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/dkaOzlzleEdDJibKuXxajUVW>)
frgo has joined #amaranth-lang
<RobTaylor[m]> a different option for these users would be a docs addition where to use @no_type_check, but I think that doesn't work with classes in mypy still (works with pyright>1.1.347 though)
<RobTaylor[m]> <RobTaylor[m]> "a different option for these..." <- oh no. pyright also doesnt honour @no_type_check on classes
frgo has quit [Remote host closed the connection]
frgo has joined #amaranth-lang
<whitequark[cis]> <RobTaylor[m]> "Catherine: i hacked up a patch..." <- > <@rob_chipflow:matrix.org> Catherine: i hacked up a patch last night to allow the use of Annotated[] in data.Flow members, for those users who wish to have full type checking available for their codebase. Would it be of interest if I finish that up... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/IOxmeLzwhZPDJQxMgAgQALqI>)
<RobTaylor[m]> whitequark[cis]: hmm, its more about users actually being able to write code with a type checker enabled
<RobTaylor[m]> rather than typing for amaranth overall
<RobTaylor[m]> its only view/struct/union that breaks
<RobTaylor[m]> happy to write that up though
<RobTaylor[m]> currently even switching to basic doesnt work with pyright :(
<RobTaylor[m]> (i.e. the only solution i have right now is to # type ignore)
<whitequark[cis]> Rob Taylor: please read all of https://github.com/amaranth-lang/rfcs/pull/11 first, as the reasons that RFC was closed would have to be addressed first
<RobTaylor[m]> whitequark[cis]: will do!
<RobTaylor[m]> Yep, think i can answer all that, went through PEP 649 and PEP 563 a few times yesterday (both accepted now)
<RobTaylor[m]> I'll see what I can pull together
<whitequark[cis]> oh, they are accepted? that's actually kind of disappointing
<whitequark[cis]> wait no 649 is fine
<whitequark[cis]> okay, I re-read 649, this is in fact a good way to implement them and should not have negative effects on us