Closed ughstudios closed 2 years ago
global variables are rarely clean and introduce quite a few failure scenarios. For example:
na1
vs americas
vs na
for most apis, matchv5, and ddragon respectively)na1
in LoL, americas
in Valorant)On top of this, this would be extremely difficult to do while maintaining backwards compatibility.
Will not do.
It does not need to be "global" but it can be based on the instance of the object. Why not make things easier for people to use?
Because it's a breaking change for any existing users that choose to use it, messes up the type hints on all existing functions, and forces all users to use kwargs
if they want to opt in for some code but not all.
And it makes documentation significantly more difficult, as the region parameter only sometimes exists.
Can we remove the region from all of the api calls? It's really annoying having to constantly pass
region
in each call. Can this be instead changed to a global variable within the api? Ideally, you have something like this:I think this would be a lot cleaner