Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template for city #737

Open
ghost opened this issue Jan 4, 2023 · 0 comments
Open

Template for city #737

ghost opened this issue Jan 4, 2023 · 0 comments

Comments

@ghost
Copy link

ghost commented Jan 4, 2023

In the Brazil file I would like to see a generic class for city. This generic class can be instancied with a string parameter and according to this parameter we will instanciate some specific city class.
Example:

Class GenericCity():
  def __new__(cls, city: str):
          if city=='sp:
              return BrazilSaoPauloCity
          elif city =='rj'
             return BrazilRiodeJaneiroCity
          return super().__new__(cls)
  def __init__(cls):
     ....

city = GenericCity('sp')
city is a BrazilSaoPauloCity class.

@brunobord what do you think?
I can do a PR for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants