See the help docs for cherrypy.popargs. It pops path components, and supplies them as keyword arguments to the next handler. In this case, use it as a decorator on the people resource, and attach a pets resource to the people resource.
@cherrypy.popargs('petID')
class Pets:
...
@cherrypy.popargs('personID')
class People:
...