Notice: Over the next few months, we're reorganizing the App Engine documentation site to make it easier to find content and better align with the rest of Google Cloud products. The same content will be available, but the navigation will now match the rest of the Cloud products.

Python 3.10 is now generally available.

google.appengine.api.validation.TYPE_BOOL

Verifies property is of expected type.

Can optionally convert value if it is not of the expected type.

It is possible to specify a required field of a specific type in shorthand by merely providing the type. This method is slightly less efficient than providing an explicit type but is not significant unless parsing a large amount of information:

  class Person(Validated):
    ATTRIBUTES = {'name': unicode,
                  'age': int,
                  }

However, in most instances it is best to use the type constants:

  class Person(Validated):
    ATTRIBUTES = {'name': TypeUnicode,
                  'age': TypeInt,
                  }