Question: Is there a pythonic way to check if two objects are of one specific type? I suppose this is more of academic interest than actual code necessity.

Obviously using two `isinstance()` would work, and the triple equation does the trick as well, but I was wondering if there is a one-liner that would work and be pythonic as well.

```py
if type(obj1) == type(obj2) == MyClass:
    #DoSomething

```

since this is equivalent to

```py
if (type(obj1) == type(obj2)) and (type(obj2) == MyClass):
    #DoSomething

```

the left check will raise a PEP8 warning to use `isinstance()`

Answer: 
There's a feature request for this, and a workaround proposed that works some of the time: [feature request: z-ordering parameter for traces](https://github.com/plotly/plotly.py/issues/2345).

```py
import plotly.express as px
import plotly.graph_objects as go

fig = px.scatter(x=[1,2,3,4], y=[1,2,3,4], size=[1,2,3,4], color=["a","a","b","b"])
fig.add_trace(go.Scatter(x=[1,2,3,4], y=[1,2,3,4], mode="lines", line_color="black"))

# Re-order the data:
fig.data = (fig.data[1],fig.data[0])
# fig.data = fig.data[::-1]  # alternatively, via slicing

fig.show()

```
I found a clever way around it. In this case, you first assign the graph object to a variable:

```
PLOT1 = go.Scatter(STUFF)
PLOT2 = go.Scatter(STUFF)
PLOT3 = go.Scatter(STUFF)

```

You can then specify a dictionary with the desired order:

```
order = {"1":PLOT3, "2":PLOT1, "3":PLOT2}

for i in np.arange(1, len(order) + 1):
    for plot_order, trace in order.items():
        if plot_order == str(i):
            fig.add_trace(trace)

```

This way you control the order with the dictionary. I hope it helps! It helped me.