pokemon-types not being answered correctly
Closed this issue · 1 comments
dns-ls commented
Tried on both Windows and Linux, when requesting for pokemons type, the API always answers something like this (instead of "fire"):
>>> import pokebase as pb
>>> print(pb.pokemon('charmander').types)
[<pokebase.interface.APIMetadata object at 0x00000212A9AE6710>]
khancerberus commented
Try with:
for type in pb.pokemon('charmander').types:
print(type.name)
Why? 'types' returns a type list, and type object is an APIMetadata object. According to the PokeAPI, a type request can contains:
{
"id": 5,
"name": "ground",
... more json data
}