Welcome, guest | Sign In | My Account | Store | Cart
def AreStringsIdentifiers(*strings):
   try:
      class test(object): __slots__ = strings
   except TypeError:
      return False
   else:
      return True

if __name__ == '__main__':
   print
   print AreStringsIdentifiers('A', 'B') # -> True
   print AreStringsIdentifiers('A', '1B', 'x y') # -> False

History

  • revision 3 (18 years ago)
  • previous revisions are not available