When I execute the following code:
import re
phoneNumRegex = re.compile("")
print(type(phoneNumRegex))
I get output:
<class '_sre.SRE_Patte'>
However, if I try and use type(phoneNumRegex) in an if statement, I need to parse it as a str for it to work as intended:
if str(type(phoneNumRegex)) == "<class '_sre.SRE_Patte'>":
print("This if statemnt works")
Note how it reads str(type(phoneNumRegex)) above, not type(phoneNumRegex). My question is, why must I parse type(phoneNumRegex) as a str when I use it in an if statement?
