2 ms·
That byte code is then interpreted at runtime, so the meaning of s.upper() could change. What something does, when it’s parsed, is not fixed. You can definitel
by nomel 6y ago
That byte code is then interpreted at runtime, so the meaning of s.upper() could change. What something does, when it’s parsed, is not fixed.
You can definitely catch most cases at runtime. I’ve done something like this, in an library, to catch a case where people were treating the copy of data as a mutable view.
interface[address][slice] = new_values # fancy noop
Where a read, modify, write was required:
byte_values = interface[address]
byte_values[slice] = new_values
interface[address] = byte_values
It would log/raise a useful error if the there was no assignment/passing of the return value.