You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Working at test_sdfq.sage my LSP warning me about the next code being inconsistent because we give two inputs to log, but only one is required (as we are really using log2).
Since this situation is very tricky, and can easily become a nightmare to debug, we should swap the load and import declarations in every file, making each file completely predictable in its scope.
Working at test_sdfq.sage my LSP warning me about the next code being inconsistent because we give two inputs to log, but only one is required (as we are really using
log2
).Which is weird because that is true, but our tests are working.
After some debugging I found the culprit to be the intermediate Sage load functions:
Because loading is equivalent to execute the Sage file within the global scope, the normal
log
import used inattack_cost.sage
was overriding ourlog2 as log
, allowing all the subsequent code work.Proposed solution
Since this situation is very tricky, and can easily become a nightmare to debug, we should swap the
load
andimport
declarations in every file, making each file completely predictable in its scope.Previous example would end up like this:
Which will produce errors, but those are predictable and easy to fix.
I will start making these changes on the files I have access to while making the
tests
directory refactor, and let the others for later.The text was updated successfully, but these errors were encountered: