Editorial Date · 2026-09-08

Start by noting the version of Python, the command used, and the first error. Reduce the input to the smallest failing example. Remove secrets and private paths from the log before providing it with the relevant code.

Isolating and then fixing

With this code and this error, propose a testable hypothesis. Write a test that reproduces the problem and shows the only lines that need to be changed after the test.

Keep the proof

Check the difference in your version control tool. If multiple changes were proposed, test them separately. Note the test command and the corrected case so you can reproduce the verification after a future update.

Example of an error on an empty list

A script needs to calculate an average and fails when no value is provided. Prepare three test inputs: a list with two known values, an empty list, and a list with an invalid value. Write the contract before requesting a fix. In your application, an empty list can request a missing result, a clear message, or another rule defined by the caller.

Provide NEO with the relevant function, the error message, and the expected result. Request the cause and the smallest change that satisfies the contract. Run the empty list test and then verify that the calculation on the two known values ​​remains the same. Confirm the behavior on the invalid input with the caller.

Verify the change in the project.

If the behavior differs depending on the input format, save a small example of each allowed format. Note the result of each test. This will help you distinguish a calculation error from a data read problem.

See also

Write a proof of correctness around the failing case.

Give NEO the full error message, the script's role, and an example input that is sufficient to reproduce the problem. Use dummy data with the same structure if the real file contains personal information. For an empty list, keep the exact form of the input and describe the expected behavior. A reporting script might need to display "no data" and produce a valid file.

Request an explanation that relates the message to the line and the condition. An averaging error on an empty list might come from a division when the number of elements is zero. Before modifying the function, decide what value or result is acceptable to its callers. An arbitrary numerical value could be interpreted as a true measurement. A clearly handled absence of a result allows the rest of the program to choose the display.

Starting from this minimal case, it proposes a targeted correction. It explains why the error occurs and provides a check for empty input, normal input, and input in an invalid format.

Apply the fix to a copy and run these three cases. Compare the normal result to the result produced before the change. Also check the message used when the input is invalid. Keep the execution commands and the expected output close to the working folder. This will allow you to retest after another update and distinguish a local fix from a change in behavior elsewhere in the project.