Skip to content

Stable release 1.0.3

Compare
Choose a tag to compare
@GLEF1X GLEF1X released this 16 Jul 14:18
· 92 commits to dev-1.x since this release
880a78a

There are couple of changes from 1.0.3b2:

  1. The library now fully supports the mypy linter and therefore BaseFilter has become Generic class and so you can use like shown below:
from glQiwiApi import BaseFilter, QiwiWrapper, types

wrapper = QiwiWrapper()


class MyBillFilter(BaseFilter[types.Notification]):

    async def check(self, update: types.Notification) -> bool:
        return True


async def my_bill_handler(update: types.Notification) -> None:
    ...


# 2 errors, connected with incorrect type of argument, which accept handler and wrong type of filter
wrapper.dp.register_transaction_handler(my_bill_handler, MyBillFilter())

wrapper.dp.register_bill_handler(my_bill_handler, MyBillFilter())  # It's ok and mypy understand it
  1. In 1.0.3 you can add shutdown_callback to your async_as_sync decorator or sync function to gracefully shutdown all your resources