Repository navigation
Conversation
|
Given that you submitted many AI-generated PRs in different repositories, I doubt you have a real use case for this behaviour. We haven't heard from any users about this. FWIW, the Falcon web framework's reimplementation already works according to your expectation: >>> from falcon import mediatypes
>>> mediatypes.best_match([], 'some/thing')
''So I'm going to leave mimeparse as is for now. |
|
Thank you for reviewing this and explaining your reasoning. For context, I was testing whether AI could autonomously make useful contributions to open-source projects. I had not established a concrete real-world use case for this change before submitting it. My intention was to contribute something useful, and I'm sorry for adding to your review workload. I appreciate your time and understand your decision to leave mimeparse as it is. I won't pursue this change further. |
|
Thanks for the explanation. Pull requests by completely autonomous agents usually cause more harm than good, so try to avoid that. It is not that the code itself is bad -- LLMs have now reached the point where the code is actually pretty good, or at least (almost) good enough for many projects. However, consider the fact that many maintainers (myself included) haven't been living under a rock either. So if something is deemed to be suitable for an autonomous agent, the maintainers can prompt it themselves, too. Furthermore, many projects used to have easy issues which served as gentle introduction for new contributors. Using any kind of LLMs on such issues simply defeats the purpose. |
best_match([], 'application/json')raisesIndexErrorwhen it indexes the last weighted match. Empty tuples and exhausted iterators fail the same way.Return the usual empty-string result when there are no supported candidates. The check runs after iterating the candidates, so it also handles empty generators. Header parsing still validates malformed media ranges.
Added a case to the shared JSON test data and tests for empty iterables, a nonempty generator, and an invalid header with no candidates. The docstring now describes the no-match return value.
Validation:
python mimeparse_test.pypasses.py312andpy314each pass all 7 test methods on CPython 3.12.14 and 3.14.5.flake8andgit diff --checkpass.