bug in typecasting

This commit is contained in:
phixxy 2024-01-28 23:13:31 -08:00
parent ffc463a5e3
commit 3854a9b03c

View file

@ -15,7 +15,7 @@ async def get_json(self, url):
class Pokemon: class Pokemon:
async def __init__(self, id: int, generate: bool = True) -> None: async def __init__(self, id: int, generate: bool = True) -> None:
if generate: # Should I even do it this way? if generate: # Should I even do it this way?
self.json_data = await self.get_pkmn_from_id(id: int) self.json_data = await self.get_pkmn_from_id(id)
async def get_pkmn_from_id(id): async def get_pkmn_from_id(id):
url = 'https://pokeapi.co/api/v2/pokemon/' + str(id) url = 'https://pokeapi.co/api/v2/pokemon/' + str(id)