Python 3 Typeerror Cannot Use A String Pattern On A Ring