One function

DEFINE_multi_enum_class in abseil/abseil-py

The author described this change as Fix DEFINE_multi_enum_class's additional kwargs (e.g. short_name).. It counts as a record because the check below fails on the code as it stood at c75edbb71 and passes on be755cb76, with nothing else changed between the two runs.

Fix saved2022-11-07
Sharing licenceApache-2.0 · LICENSE
Change size+8 2

What the code was meant to do, written into the code itself as a docstring

Registers a flag whose value can be a list of enum members. Use the flag on the command line multiple times to place multiple enum values into the list. Args: name: str, the flag name. default: Union[Iterable[Enum], Iterable[Text], Enum, Text, None], the default value of the flag; see `DEFINE_multi`; only differences are documented here. If the value is a single Enum, it is treated as a single-item list of that Enum value. If it is an iterable, text values within the iterable will be converted to the equivalent Enum objects. enum_class: class, the Enum class with all the possible values for the flag. help: str, the help message. flag_values: :class:`FlagValues`, the FlagValues instance with which the flag will be registered. This should almost never need to be overridden. module_name: A string, the name of the Python module declaring this flag. If not provided, it will be computed using the stack trace of this call. case_sensitive: bool, whether to map strings to members of the enum_class without considering case. required: bool, is this a required flag. This must be used as a keyword argument. **args: Dictionary with extra keyword args that are passed to the `Flag.__init__`. Returns: a handle to defined flag.

The change

3838 """
3939 return DEFINE_flag(
4040 _flag.MultiEnumClassFlag(
41- name, default, help, enum_class, case_sensitive=case_sensitive),
41+ name,
42+ default,
43+ help,
44+ enum_class,
45+ case_sensitive=case_sensitive,
46+ **args,
47+ ),
4248 flag_values,
4349 module_name,
4450 required=required,
45- **args)
51+ )

The check that tells the two apart

failpass·absl/flags/tests/flags_test.py::MultiEnumClassFlagsTest::test_short_name

Check file absl/flags/tests/flags_test.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before itc75edbb71e6942d72d41a57d9cd10c9628d4cb0a
Broken version dated2022-10-11
Moduleabsl.flags._defines
Units changedDEFINE_multi_enum_class
Fingerprint0d4eafb90fcd9987
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.