Currently, I have below Python inherited class structure and created the small factory class to get the instance of the child class as below.

Here I wanted suggestions

1. Is this a good approach or any better way to implement this?
2. Inside the `PersonFacotry` class in `create` method, as of now, I am setting the return type as
`Any`, Is it possible to dynamically return the type as `Engineer` or `Doctor` ?

```
from typing import Any

class Person: pass

class Engineer(Person): pass

class Doctor(Person): pass

class PersonFactory:
    class_mapper = {'engineer': Engineer, 'doctor': Doctor}

    @classmethod
    def create(cls, type: str) -> Any:
        return cls.class_mapper[type]

doctor_instance = PersonFactory().create('doctor')()
engineer_instance = PersonFactory().create('engineer')()

```

Thanks a lot in advance!!