Here’s an example with things broken out to separate files:
https://github.com/pulumi/examples/tree/master/gcp-py-network-component
the config.py is simply about pulling reused bits of code out of the main file.
The instance.py and network.py are examples of component resource definitions where you are able to create a reusable class that encapsulates, say, best practices around setting up a network.