mdaniel a day ago

This response highlights both parts what I was saying: it's not just strings, and "I'm sure there's some extra things that the standard library wants you to duct tape together, good luck"

  • mixmastamyk a day ago

    It is exactly two strings that are required. The docs are there for flags etc, use them. Types were not entered directly into stdlib source for historical reasons.

    If you would enjoy further support, install stubs from typeshed.

    • mdaniel a day ago

      > It is exactly two strings that are required

      It is exactly as I said, it's not just strings

          $ python3.12 -c '
          import re
          pat = re.compile("who knew")
          ma = re.match(pat, "who knew types matter")
          print(ma)
          '
          <re.Match object; span=(0, 8), match='who knew'>
      
      > The docs are there for flags etc, use them.

      I guess it's good we're all using LLMs nowadays, since in general computers no read so good, that's why we write in specialized languages for their benefit. That would include this fancy new thing I've heard about where one writes down what the input and output domains are for functions

      > Types were not entered directly into stdlib source for historical reasons.

      Historical reasons defeats the purpose of having git tags, to say nothing of them having several concurrent branches named after the various release trains. I mean, historically print was a keyword, but you sure don't see them from __future__ import print_statement all over the 3.12 tree now do you? It's because they DGAF preferring there to be seemingly unlimited aftermarket tooling to try and drag python3000 into the 21st century

      > If you would enjoy further support, install stubs from typeshed.

      While trying to dig up whatever a sane person would use to "install stubs" -- because it for damn sure isn't $(pip install typeshed) -- I learned that you were even more incorrect - it accepts bytes, too https://github.com/python/typeshed/blob/9430260770b627c04313...

      Anyway, they also go out of their way to say "don't install typeshed" and I guess that's why they don't have any git tags because releases are for children

      • mixmastamyk a day ago

        Right, the first arg can also be a compiled pattern|bytes. Not an issue in the real world however. The problem is when it can't handle what you give it, not when it can handle what you give it and additional things.

        Normally you'd use `pattern.match(string)` in that case.

        They said specifically more than once that they're not going to change (almost) every line in the repo for any reason, and not only to types but other syntax improvements. Probably to keep git blame intact and avoid introducing new bugs.

        Honestly, this reads as an obsession with theoretical concerns.