From d4df0c3258f7fe2ce30b665c1049d5d87b8fdd9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20S=C3=A1nchez=20Castro?= <72013291+JavierSanchezCastro@users.noreply.github.com> Date: Fri, 10 May 2024 11:10:24 +0100 Subject: [PATCH] Update routing.py --- fastapi/routing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastapi/routing.py b/fastapi/routing.py index 13ccf9ab94..68216ac492 100644 --- a/fastapi/routing.py +++ b/fastapi/routing.py @@ -1204,7 +1204,7 @@ class APIRouter(routing.Router): app.include_router(internal_router) ``` """ - assert id(self) != id(router), "Router cannot be the same as parent" + assert self is not router, "Router cannot be the same as parent" if prefix: assert prefix.startswith("/"), "A path prefix must start with '/'" assert not prefix.endswith(