Python doesn’t use constants, so you have to port only the destructuring, which Python also doesn’t have (at least not exactly like ES6).
You can, however, do this:
entities, classification = [obj[k] for k in ("entities", "classification")]
Or, according to this, use the itemgetter
.
from operator import itemgetter
entities, classification = itemgetter("entities", "classification")(obj)
CLICK HERE to find out more related problems solutions.