GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    Merc (merc@fanimations.club)'s status on Thursday, 20-Aug-2026 08:51:14 JST Merc Merc

    I just called for...else the "en passant of python"

    In conversation about 2 days ago from fanimations.club permalink
    • Embed this notice
      Merc (merc@fanimations.club)'s status on Thursday, 20-Aug-2026 08:51:07 JST Merc Merc
      in reply to
      • Kirby

      @kirby ```python3

      def better_for_loop[T](it: Iterable[T], fin: Callable[[], None] = lambda: None) -> Generator[T, None, bool]:
      if not it:
      return False
      yield from it
      fin()
      return True

      Citation for subscriptable functions notation: https://discuss.python.org/t/pep-718-subscriptable-functions/28457
      In conversation about 2 days ago permalink

      Attachments

      1. Domain not in remote thumbnail source whitelist: us1.discourse-cdn.com
        PEP 718: subscriptable functions
        TLDR; This PEP proposes making various function-like instances subscriptable for typing purposes so doing things like: def create_list[T](*args: T) -> list[T]: ... create_list[int]() # type is list[int] would work without raising a TypeError. Previous discussion: Making functions subscriptable at runtime Thanks for reading, happy to answer any questions.
    • Embed this notice
      T man :sex: :puffgiga: :puffpowerroll: (theorytoe@ak.kyaruc.moe)'s status on Thursday, 20-Aug-2026 08:51:07 JST T man :sex: :puffgiga: :puffpowerroll: T man :sex: :puffgiga: :puffpowerroll:
      in reply to
      • Kirby
      @Merc @kirby
      is that a fucking python generic
      In conversation about 2 days ago permalink
    • Embed this notice
      Merc (merc@fanimations.club)'s status on Thursday, 20-Aug-2026 08:51:08 JST Merc Merc
      in reply to
      • Kirby

      @kirby "breaking change" so what nigga who the fuck uses this anyways.

      from future import for_else_is_finally

      In conversation about 2 days ago permalink
    • Embed this notice
      Merc (merc@fanimations.club)'s status on Thursday, 20-Aug-2026 08:51:09 JST Merc Merc
      in reply to
      • Kirby

      @kirby This is stupid. Make for...else for if the iterable evaluates false (if there's a for _ in x...else, have that be syntactic sugar for if x for _ in x... else), then use finally. You'd need to decide if the finally would trigger even if the for loop returns (I would make it so), though.

      In conversation about 2 days ago permalink
    • Embed this notice
      Merc (merc@fanimations.club)'s status on Thursday, 20-Aug-2026 08:51:10 JST Merc Merc
      in reply to
      • Kirby

      @kirby I'm not retarded, that should be the intuitive understanding of it. Its iterable was empty, so it evaluates to false (unless you did something stupid), so the else triggers

      In conversation about 2 days ago permalink
    • Embed this notice
      Merc (merc@fanimations.club)'s status on Thursday, 20-Aug-2026 08:51:11 JST Merc Merc
      in reply to
      • Kirby

      @kirby I figure it's rare but if it's an option you gotta do it for the meme

      In conversation about 2 days ago permalink
    • Embed this notice
      Merc (merc@fanimations.club)'s status on Thursday, 20-Aug-2026 08:51:11 JST Merc Merc
      in reply to
      • Kirby

      @kirby fuck I looked it up, I thought the else only triggered if the for loop was empty

      In conversation about 2 days ago permalink
    • Embed this notice
      Kirby (kirby@fanimations.club)'s status on Thursday, 20-Aug-2026 08:51:13 JST Kirby Kirby
      in reply to

      @Merc not a terrible description. it probably is an afterthought

      In conversation about 2 days ago permalink
    • Embed this notice
      T man :sex: :puffgiga: :puffpowerroll: (theorytoe@ak.kyaruc.moe)'s status on Thursday, 20-Aug-2026 08:53:52 JST T man :sex: :puffgiga: :puffpowerroll: T man :sex: :puffgiga: :puffpowerroll:
      in reply to
      • Kirby
      @Merc @kirby
      >C[int]().method[str](0, "")
      >char (*(*x())[5])()
      In conversation about 2 days ago permalink
    • Embed this notice
      Merc (merc@fanimations.club)'s status on Thursday, 20-Aug-2026 08:53:53 JST Merc Merc
      in reply to
      • T man :sex: :puffgiga: :puffpowerroll:
      • Kirby

      @theorytoe @kirby https://discuss.python.org/t/pep-718-subscriptable-functions/28457 I read the fucking forums this has Guido's blessing

      In conversation about 2 days ago permalink

      Attachments

      1. Domain not in remote thumbnail source whitelist: us1.discourse-cdn.com
        PEP 718: subscriptable functions
        TLDR; This PEP proposes making various function-like instances subscriptable for typing purposes so doing things like: def create_list[T](*args: T) -> list[T]: ... create_list[int]() # type is list[int] would work without raising a TypeError. Previous discussion: Making functions subscriptable at runtime Thanks for reading, happy to answer any questions.
    • Embed this notice
      T man :sex: :puffgiga: :puffpowerroll: (theorytoe@ak.kyaruc.moe)'s status on Thursday, 20-Aug-2026 08:54:17 JST T man :sex: :puffgiga: :puffpowerroll: T man :sex: :puffgiga: :puffpowerroll:
      in reply to
      • pwm
      • Kirby
      @pwm @Merc @kirby
      py "five trillion morbillion features" thon
      In conversation about 2 days ago permalink
    • Embed this notice
      pwm (pwm@darkdork.dev)'s status on Thursday, 20-Aug-2026 08:54:18 JST pwm pwm
      in reply to
      • T man :sex: :puffgiga: :puffpowerroll:
      • Kirby
      @theorytoe @Merc @kirby it's the type hint syntax for it yeah
      In conversation about 2 days ago permalink
    • Embed this notice
      T man :sex: :puffgiga: :puffpowerroll: (theorytoe@ak.kyaruc.moe)'s status on Thursday, 20-Aug-2026 09:00:00 JST T man :sex: :puffgiga: :puffpowerroll: T man :sex: :puffgiga: :puffpowerroll:
      in reply to
      • pwm
      • Kirby
      @pwm @Merc @kirby
      NUTZ
      In conversation about 2 days ago permalink
    • Embed this notice
      pwm (pwm@darkdork.dev)'s status on Thursday, 20-Aug-2026 09:00:01 JST pwm pwm
      in reply to
      • T man :sex: :puffgiga: :puffpowerroll:
      • Kirby
      @Merc @theorytoe @kirby bolton these
      In conversation about 2 days ago permalink
    • Embed this notice
      Merc (merc@fanimations.club)'s status on Thursday, 20-Aug-2026 09:00:02 JST Merc Merc
      in reply to
      • T man :sex: :puffgiga: :puffpowerroll:
      • pwm
      • Kirby

      @pwm @theorytoe @kirby Not everything, sigh

      https://boltons.readthedocs.io/en/latest/
      https://grantjenks.com/docs/sortedcontainers/
      uhhhhh I guess pandas and numpy too. And pyyaml. Maybe pillow.

      In conversation about 2 days ago permalink

      Attachments

      1. Domain not in remote thumbnail source whitelist: grantjenks.com
        Python Sorted Containers — Sorted Containers 2.4.0 documentation
    • Embed this notice
      pwm (pwm@darkdork.dev)'s status on Thursday, 20-Aug-2026 09:00:03 JST pwm pwm
      in reply to
      • T man :sex: :puffgiga: :puffpowerroll:
      • Kirby
      @theorytoe @Merc @kirby batteries in fucking cluded
      In conversation about 2 days ago permalink
    • Embed this notice
      Merc (merc@fanimations.club)'s status on Thursday, 20-Aug-2026 09:00:55 JST Merc Merc
      in reply to
      • T man :sex: :puffgiga: :puffpowerroll:
      • Kirby

      @theorytoe @kirby You can do shit like l = list[T]() and I think that's pretty sexy but the people here hate it.

      In conversation about 2 days ago permalink
      T man :sex: :puffgiga: :puffpowerroll: likes this.
    • Embed this notice
      T man :sex: :puffgiga: :puffpowerroll: (theorytoe@ak.kyaruc.moe)'s status on Thursday, 20-Aug-2026 09:01:28 JST T man :sex: :puffgiga: :puffpowerroll: T man :sex: :puffgiga: :puffpowerroll:
      in reply to
      • Kirby
      @Merc @kirby
      I mean im the one to talk considering half of my pet project is fucking generics
      In conversation about 2 days ago permalink

      Attachments


      1. https://ak.kyaruc.moe/media/c6fb17e8-1f26-4b68-92f2-d805b8dc2261/image.png
    • Embed this notice
      Merc (merc@fanimations.club)'s status on Thursday, 20-Aug-2026 09:04:23 JST Merc Merc
      in reply to
      • T man :sex: :puffgiga: :puffpowerroll:
      • Kirby

      @theorytoe @kirby I should just start writing in Cython and see if people tell me to fuck off

      In conversation about 2 days ago permalink
    • Embed this notice
      T man :sex: :puffgiga: :puffpowerroll: (theorytoe@ak.kyaruc.moe)'s status on Thursday, 20-Aug-2026 09:04:23 JST T man :sex: :puffgiga: :puffpowerroll: T man :sex: :puffgiga: :puffpowerroll:
      in reply to
      • Kirby
      @Merc @kirby
      idk man the concept of a generic in python seems way more stupid than in a statically typed language
      In conversation about 2 days ago permalink
    • Embed this notice
      Merc (merc@fanimations.club)'s status on Thursday, 20-Aug-2026 09:07:16 JST Merc Merc
      in reply to
      • T man :sex: :puffgiga: :puffpowerroll:
      • Kirby

      @theorytoe @kirby I think it's useful to say 'whatever type this is, if it occurs here, it will also occur here'

      If you're getting to more complicated shit like 'whatever type this is, a subtype with __open__ defined on it will occur here', you are going to hell you are going to hell you are going to hell you are g

      In conversation about 2 days ago permalink
      T man :sex: :puffgiga: :puffpowerroll: likes this.
    • Embed this notice
      T man :sex: :puffgiga: :puffpowerroll: (theorytoe@ak.kyaruc.moe)'s status on Thursday, 20-Aug-2026 09:08:53 JST T man :sex: :puffgiga: :puffpowerroll: T man :sex: :puffgiga: :puffpowerroll:
      in reply to
      • Kirby
      @Merc @kirby
      fair, but even then considering you can just have shit happen if you dont specify types its like why have a generic when T is T
      In conversation about 2 days ago permalink

      Attachments


      1. https://ak.kyaruc.moe/media/34de3141-8dfc-43dd-aea1-66399010d993/image.png
    • Embed this notice
      T man :sex: :puffgiga: :puffpowerroll: (theorytoe@ak.kyaruc.moe)'s status on Thursday, 20-Aug-2026 09:09:52 JST T man :sex: :puffgiga: :puffpowerroll: T man :sex: :puffgiga: :puffpowerroll:
      in reply to
      • T man :sex: :puffgiga: :puffpowerroll:
      • Kirby
      @Merc @kirby also did not intend for the second case to be the way it is
      In conversation about 2 days ago permalink
    • Embed this notice
      T man :sex: :puffgiga: :puffpowerroll: (theorytoe@ak.kyaruc.moe)'s status on Thursday, 20-Aug-2026 09:10:56 JST T man :sex: :puffgiga: :puffpowerroll: T man :sex: :puffgiga: :puffpowerroll:
      in reply to
      • T man :sex: :puffgiga: :puffpowerroll:
      • Kirby
      @Merc @kirby like who the fuck even cares anymore
      In conversation about 2 days ago permalink

      Attachments


      1. https://ak.kyaruc.moe/media/425461a9-5eed-46a0-ba98-a952235c3299/image.png
    • Embed this notice
      T man :sex: :puffgiga: :puffpowerroll: (theorytoe@ak.kyaruc.moe)'s status on Thursday, 20-Aug-2026 09:12:14 JST T man :sex: :puffgiga: :puffpowerroll: T man :sex: :puffgiga: :puffpowerroll:
      in reply to
      • T man :sex: :puffgiga: :puffpowerroll:
      • Kirby
      @Merc @kirby turns out me being retarded didnt change anything
      In conversation about 2 days ago permalink

      Attachments


      1. https://ak.kyaruc.moe/media/b3ad4705-a6db-4708-8cc5-a33dc775bcfe/image.png
    • Embed this notice
      Merc (merc@fanimations.club)'s status on Thursday, 20-Aug-2026 09:24:48 JST Merc Merc
      in reply to
      • T man :sex: :puffgiga: :puffpowerroll:
      • Kirby

      @theorytoe @kirby I do wish giving type annotations was syntax sugar for having asserts that it is that type :P

      In conversation about 2 days ago permalink
      T man :sex: :puffgiga: :puffpowerroll: likes this.
    • Embed this notice
      T man :sex: :puffgiga: :puffpowerroll: (theorytoe@ak.kyaruc.moe)'s status on Thursday, 20-Aug-2026 09:28:48 JST T man :sex: :puffgiga: :puffpowerroll: T man :sex: :puffgiga: :puffpowerroll:
      in reply to
      • Kirby
      @Merc @kirby
      i mean to be fair this is why I dont write production code in python
      In conversation about 2 days ago permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.