[Python] Endpoints accessible even after being commented out [closed]

Discussão em 'Python' iniciado por Stack, Setembro 2, 2025.

  1. Stack

    Stack Membro Participativo

    I am experimenting with FastAPI and Uvicorn. I see a strange issue.

    I have commented out all endpoint-related code:

    from fastapi import FastAPI
    #from app.routes.hello import router as hello_router

    app = FastAPI(title="Fast API")

    # Include routers
    #app.include_router(hello_router)

    @app.get("/")
    def root():
    return {"message": "Welcome to FastAPI!"}



    from fastapi import APIRouter

    #router = APIRouter(prefix="/hello", tags=["hello"])

    #@router.get("/")
    async def say_hello():
    return {"message": "Hello, FastAPI!"}


    I restart program, I cleared all possible caches, still I can access this endpoint.

    Why this behaviour?

    Continue reading...

Compartilhe esta Página