I am working on converting some JavaScript code into Python.
There is an if condition in the JavaScript that looks something like:
if (typeof f === 'object')
and then a series of actions are taken if this condition evaluates to true.
In this case f
would be something like:
f = { 'fields': ["user_id", "date_started", "date_ended"] }
In this case f
is a dict
, but it might not always be the case.
I know that in JavaScript nearly everything is considered an object.
What would be the equivalent constraint to object
in Python?