cyberkitsune / PSO2Proxy

A protocol proxy for PSO2
GNU Affero General Public License v3.0
46 stars 42 forks source link

Make sure kick is integer #122

Closed XenoWarrior closed 9 years ago

XenoWarrior commented 9 years ago

I failed a few times. (have not touched Python in a while :P)

There we go, you can make it explicitly check and return an error saying "NOT INT!!", but this works anyway.

(AIDA requested this :3)

Note to AIDA: checking if variable is type int works as so: type(variableName) == int // Returns true or false based on whether the value is an integer.

AmericanEnglish commented 9 years ago

You could use the isinstance() function such that: isinstance(5, int) -True isinstance('string', str) -True

XenoWarrior commented 9 years ago

They both work. isinstance(var, type) is an elegant way to do type(var) == type.