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
jn has quit [Ping timeout: 260 seconds]
jn has joined #amaranth-lang
jn has joined #amaranth-lang
<_whitenotifier-f> [amaranth] whitequark commented on pull request #1357: Replace use of _reset with _init in Xilinx platform. - https://github.com/amaranth-lang/amaranth/pull/1357#issuecomment-2105461150
vipqualitypost[m has joined #amaranth-lang
<vipqualitypost[m> what is this? is this just not implemented? is `...` something that does something specific in python?
<Wanda[cis]> it's an abstract property, it doesn't have a real implementation
<Wanda[cis]> the body will never be executed, since the abstractmethod will step in and raise an exception first
<vipqualitypost[m> so this just helps python know that it will do something in the future? I see message used later
<vipqualitypost[m> ah, ok, cool
<Wanda[cis]> ... is just a convenient way to write a body that does nothing
<Wanda[cis]> and conveys the "contents don't matter" part
<Wanda[cis]> vipqualitypost[m: the method is redefined by subclasses of that class
<vipqualitypost[m> yup, that's what I figured but I never saw it before, google did not show much either
<vipqualitypost[m> thank you!
<tpw_rules> `...` is technically an object in python, namely the Ellipsis object. i would say it's bad form, the preferred thing would be to write `pass`
<tpw_rules> you could put `"nothing to see here"` as the body if you like wanted
<whitequark[cis]> tpw_rules: it's not, this is literally what Ellipsis is for
<whitequark[cis]> `pass` is for cases where it actually gets executed, `...` is for cases where it does not
<tpw_rules> what is `pass` for then?
<Wanda[cis]> it's not what Ellipsis is for!
<tpw_rules> i've only ever used ellipsis for slicing
<Wanda[cis]> it's actually one of the few things in python added for the benefit of numpy
<Wanda[cis]> it's not used in the core language
<Wanda[cis]> (it's why it's an object — so you can pass it to slicing operators)
<Wanda[cis]> like come on, if it was for missing code, it'd throw an exception or something when executed
<tpw_rules> and not be isomorphic to any other value in that context
<whitequark[cis]> Wanda[cis]: huh
<whitequark[cis]> why do python docs recommend using it
<whitequark[cis]> if it's bad form
<whitequark[cis]> that doc is very particular about not using `pass`, and is where I learned to do that
<whitequark[cis]> tpw_rules: should you file a python bug?
<tpw_rules> that same page uses ... in several other locations for "put your code here"
<tpw_rules> on an abstract method there's nothing really to put other than `pass` or some arbitrary pure expression (which ... is) so i see the confusion
<whitequark[cis]> it would take exactly the same amount of space to put `pass` there so putting an ellipsis there is clearly on purpose
<tpw_rules> though it does say "Unlike Java abstract methods, these abstract methods may have an implementation. This implementation can be called via the super() mechanism from the class that overrides it."
<whitequark[cis]> which means it's the correct thing to do :3
<tpw_rules> so `...` does still have the same meaning in your screenshot of arbitrary user code, strange though it may be
<whitequark[cis]> (I'll continue using and teaching `...` in that position until the doc is fixed)
<tpw_rules> amaranth currently chooses `raise NotImplementedError`, a docstring, `pass`. nowhere does it have `...`
<tpw_rules> i'm not sure it's valid to change that doc to have `pass` because of the note that it can have a concrete implementation
<tpw_rules> it also seems others share your view and PEP8 has no word on the topic
<Wanda[cis]> I should note that while ellipsis was added for numpy, it has since become used for "body is meaningless" contexts.
<Wanda[cis]> PEP 484 explicitly says ... should be used as function body in typing interface files
<Wanda[cis]> so there's some precedent
<tpw_rules> some say `pass` is for "never should have an impl" and `...` is for "need to get around to the impl"
<Wanda[cis]> no.
<Wanda[cis]> pass is for "empty impl"
<Wanda[cis]> like, it's valid to have a function that does nothing!
<tpw_rules> sorry, yeah. "i don't intend an impl"
<tpw_rules> `raise NotImplementedError` is closer to never should have one
<Wanda[cis]> but also: I agree that Python documentation makes this unclear
<Wanda[cis]> this example is.... sigh
<Wanda[cis]> ... used for both three places where it should be literal ..., and one place where there should be actual implementation
<tpw_rules> mmh i think ... is overly cute for method bodies. but guido disagrees, at least for .pyi: https://github.com/python/typing/issues/109
<whitequark[cis]> <tpw_rules> "amaranth currently chooses `..." <- there should be a few in the typing overloads in the simulator
<tpw_rules> there seems more in alignment as it's a typing thing
<tpw_rules> you are probably right that python's docs need fixing. Wanda[cis] have you worked with python upstream at all? are you interested in tracking it down
<Wanda[cis]> I have not
<tpw_rules> me neither
Degi_ has joined #amaranth-lang
<Wanda[cis]> (or I think I did not? living with major memory loss sure is fun)
Degi has quit [Ping timeout: 268 seconds]
Degi_ is now known as Degi
sohaiber[m] has joined #amaranth-lang
<sohaiber[m]> It would be nice to iterate over Signal(ArrayLayout), currently View.__getitem__ doesnt raise IndexError, is this intended?
<Wanda[cis]> hm?
<Wanda[cis]> oh.
<Wanda[cis]> # Layout's interface requires us to raise KeyError, not IndexError yeah it is... intended
<Wanda[cis]> this sure looks like unintended consequences though
<sohaiber[m]> oh just saw that because View.getitem just uses word_select in the case of ArrayLayout
<sohaiber[m]> guess what i want can also be easily done with Signal(width*length) and word_select
<whitequark[cis]> <Wanda[cis]> "# Layout's interface requires..." <- we... could potentially raise KeyError for strings and IndexError for ints
<whitequark[cis]> this is fairly cursed but I don't necessarily see why we shouldn't do it
<Wanda[cis]> mhm
<Wanda[cis]> either that or just implement __iter__ manually
<whitequark[cis]> I think I'd prefer KeyError/IndexError since it matches the underlying intent
<Wanda[cis]> Catherine: I can just implement it, which one do you hate less?
<whitequark[cis]> (of implementing a sort of a hybrid interface)
<Wanda[cis]> okay
<whitequark[cis]> thanks!
<Wanda[cis]> I ... meow?
<whitequark[cis]> oh, was the wasmtime download interrupted halfway
<whitequark[cis]> what a strange failure
<Wanda[cis]> oh this will include a bunch of changes
<Wanda[cis]> I'll do it tomorrow then
<whitequark[cis]> hm, why did I dream of opening the https://amaranth-lang.org/schema/amaranth/0.5/component.json in a browser and getting nonsense in return
<whitequark[cis]> I might be very tired ;__;
notgull has joined #amaranth-lang
notgull has quit [Ping timeout: 268 seconds]
<_whitenotifier-f> [amaranth] bl0x commented on pull request #1357: Replace use of _reset with _init in Xilinx platform. - https://github.com/amaranth-lang/amaranth/pull/1357#issuecomment-2105611436
<_whitenotifier-f> [amaranth] github-merge-queue[bot] created branch gh-readonly-queue/main/pr-1357-631ef564aa8f33bba4aef34c53a751a33f48feb0 - https://github.com/amaranth-lang/amaranth
<_whitenotifier-f> [amaranth] github-merge-queue[bot] deleted branch gh-readonly-queue/main/pr-1357-631ef564aa8f33bba4aef34c53a751a33f48feb0 - https://github.com/amaranth-lang/amaranth
<whitequark[cis]> > ( stdlib/meta: line 266) broken https://amaranth-lang.org/schema/ - 404 Client Error: Not Found for url: https://amaranth-lang.org/schema/
<whitequark[cis]> okay we need a linkcheck exemption for that
<_whitenotifier-f> [yosys] whitequark commented on issue #32: Please add examples on how to use this module yowasp openfpgaloader - https://github.com/YoWASP/yosys/issues/32#issuecomment-2105624904
<_whitenotifier-f> [amaranth] whitequark opened pull request #1358: Exempt https://amaranth-lang.org/schema/ (exact) from linkcheck - https://github.com/amaranth-lang/amaranth/pull/1358
<_whitenotifier-f> [amaranth] github-merge-queue[bot] created branch gh-readonly-queue/main/pr-1358-631ef564aa8f33bba4aef34c53a751a33f48feb0 - https://github.com/amaranth-lang/amaranth
<_whitenotifier-f> [amaranth-lang/amaranth] github-merge-queue[bot] pushed 1 commit to main [+0/-0/±1] https://github.com/amaranth-lang/amaranth/compare/631ef564aa8f...cd679dd9b3e9
<_whitenotifier-f> [amaranth-lang/amaranth] whitequark cd679dd - docs: exempt https://amaranth-lang.org/schema/ (exact) from linkcheck.
<_whitenotifier-f> [amaranth] whitequark closed pull request #1358: Exempt https://amaranth-lang.org/schema/ (exact) from linkcheck - https://github.com/amaranth-lang/amaranth/pull/1358
<_whitenotifier-f> [amaranth] github-merge-queue[bot] deleted branch gh-readonly-queue/main/pr-1358-631ef564aa8f33bba4aef34c53a751a33f48feb0 - https://github.com/amaranth-lang/amaranth
<_whitenotifier-f> [amaranth-lang/amaranth-lang.github.io] whitequark pushed 1 commit to main [+0/-0/±36] https://github.com/amaranth-lang/amaranth-lang.github.io/compare/e0bb229ae938...2bbf76b24ee2
<_whitenotifier-f> [amaranth-lang/amaranth-lang.github.io] github-merge-queue[bot] 2bbf76b - Deploying to main from @ amaranth-lang/amaranth@cd679dd9b3e969ba385ee2833f4b90f7343d60bf 🚀
frgo has quit [Read error: Connection reset by peer]
frgo has joined #amaranth-lang
bl0x[m] has quit [Quit: Idle timeout reached: 172800s]
mcc111[m] has quit [Quit: Idle timeout reached: 172800s]
pbsds3 has joined #amaranth-lang
chaoticryptidz has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
chaoticryptidz has joined #amaranth-lang
KaliumPuceon has joined #amaranth-lang
notgull has joined #amaranth-lang
notgull has quit [Ping timeout: 264 seconds]
lf_ has quit [Ping timeout: 260 seconds]
lf has joined #amaranth-lang