``and`` has a higher priority than ``or``. The syntax of Python is defined in a way that ``(expr)`` is the same as ``expr``, the parentheses only determine the precedence level. (those two things are very common in all languages I know that contain some form of ``and``/``&&`` and parentheses to denote the precedence level). Another important thing to know is that for [boolean algebra](https://en.wikipedia.org/wiki/Boolean_algebra) the distributive law holds: ``A AND (B OR C) = A AND B OR A AND C``.

To answer your question @dpshelio: keeping these facts in mind, the first example ``tai and isinstance(time_string, int) or tai and isinstance (time_string, float)`` (I removed unnecessary parens) is equivalent to ``tai and (isinstance(time_string, int) or isinstance (time_string, float))``