Merge remote-tracking branch 'origin/dev-3.x' into dev-3.x

This commit is contained in:
Alex Root Junior 2023-02-12 01:27:39 +02:00
commit 84bc0e347b
No known key found for this signature in database
GPG key ID: 074C1D455EBEA4AC
3 changed files with 21 additions and 0 deletions

View file

@ -179,6 +179,12 @@ class Router:
self._parent_router = router
router.sub_routers.append(self)
def include_routers(self, *routers: Router) -> None:
if not routers:
raise ValueError("At least one router must be provided")
for router in routers:
self.include_router(router)
def include_router(self, router: Router) -> Router:
"""
Attach another router.