How difficult would it be to add a test that captures this missed expectation?
Yes, but by using a higher-level abstraction like a Projection simplifies the readers responsibilities. Just like dict.update(items)
provides a nice, re-usable abstraction over the more explicit [dict[key] = value for key, value in items]
, a Projection provides a valuable, re-usable concept of a subset of a dict.
Ideally, this abstraction would exist in the standard library, but until it does, I'm promoting its use here. One step toward showing value of something for the standard library is demonstrating value outside first.
Indeed, we could probably re-write this operation in C or assembly, but part of software development is building on increasingly sophisticated abstractions.
In cases where the attribute is bytes, such as in this call, this change introduces a regression with the following message:
TypeError: hasattr(): attribute name must be string
Jason R. Coombs (e5c1e7ae) at 21 Jun 18:13
narrow: indicated the default of 'Yes' when confirming auto-remove-...
On further consideration, we're thinking Y should be the default, just emphasized.
Jason R. Coombs (e082a97e) at 21 Jun 18:01
narrow: default to 'no' when removing unused includes and prompt th...
This feels unpythonic. Consider instead:
try:
retained_extras_on_rebase = rewriteutil.retained_extras_on_rebase
preserve_extras_on_rebase = rewriteutil.preserve_extras_on_rebase
except AttributeError:
With some help in chat, I'm running the tests locally by simply invoking ../mercurial/tests/run-tests.py
using a system python interpreter, and that's working about as well as the tox environment, so maybe I was whining over nothing ;).
Jason R. Coombs (4d3550a2) at 08 Jun 16:18
evolve: add a test to capture the expected behavior of retaining ex...
... and 1 more commit
Jason R. Coombs (ead34669) at 08 Jun 16:10
evolve: add a test to capture the expected behavior of retaining ex...
... and 1 more commit
Jason R. Coombs (db5c0092) at 08 Jun 16:08
fix reference