DeprecationWarning: an integer is required (got type float). Implicit conversion to integers using
int
is deprecated, and may be removed in a future version of Python.
win.blit(playerStand, (x, y))
DeprecationWarning: an integer is required (got type float). Implicit conversion to integers using
int
is deprecated, and may be removed in a future version of Python.
win.blit(walkLeft[animCount // 5], (x, y))
How do I remove deprecation warning in Python? Use warnings. filterwarnings() to ignore deprecation warnings Call warnings. filterwarnings(action, category=DeprecationWarning) with action as "ignore" and category set to DeprecationWarning to ignore any deprecation warnings that may rise.
To fix all deprecation warnings, follow the below steps: Replace update() with updateOne() , updateMany() , or replaceOne() Replace remove() with deleteOne() or deleteMany() . Replace count() with countDocuments() , unless you want to count how many documents are in the whole collection (no filter).
DeprecationWarning. Base category for warnings about deprecated features when those warnings are intended for other Python developers (ignored by default, unless triggered by code in __main__ ). SyntaxWarning. Base category for warnings about dubious syntactic features.
DeprecationWarning errors are logged by the Node. js runtime when your code (or one of the dependencies in your code) calls a deprecated API. These warnings usually include a DEP deprecation code. They are logged using console. error and end up in your CloudWatch logs.
The warning is related to the coordinate parameter of blit()
. Floating point coordinates, would mean that the origin of the Surface
is somewhere in between to pixels in the window. That doesn't make much sense. The coordinates are automatically, implicitly truncated and that is indicated by the warning.
Use either int
or round
to convert the floating point coordinates to integral numbers:
win.blit(playerStand, (round(x), round(y)))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With