{"id":22494,"library":"types-grpcio-reflection","title":"types-grpcio-reflection","description":"Typing stubs for the grpcio-reflection package, provided by typeshed. Version 1.0.0.20260408 corresponds to stubs for grpcio-reflection with Python >=3.10. Updated automatically alongside typeshed; no fixed release cadence.","status":"active","version":"1.0.0.20260408","language":"python","source_language":"en","source_url":"https://github.com/python/typeshed","tags":["grpc","reflection","typing","stubs","typeshed"],"install":[{"cmd":"pip install types-grpcio-reflection","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required at runtime; types-grpcio-reflection only provides type hints.","package":"grpcio-reflection","optional":false}],"imports":[{"note":"Wrong: direct import of internal submodule; use 'grpc_reflection.v1alpha' as a module.","wrong":"from grpc_reflection.v1alpha.proto_reflection_descriptor_database import ProtoReflectionDescriptorDatabase","symbol":"grpc_reflection.v1alpha","correct":"from grpc_reflection import v1alpha"},{"note":"Wrong: 'grpc.reflection' is a stub; 'grpc_reflection.v1' is the actual package with types.","wrong":"from grpc import reflection","symbol":"grpc_reflection.v1","correct":"from grpc_reflection import v1"}],"quickstart":{"code":"from grpc_reflection.v1alpha import reflection\nimport grpc\n\n# Example: enabling reflection on a server\nserver = grpc.server(futures.ThreadPoolExecutor(max_workers=10))\nreflection.enable_server_reflection(service_names, server)\nserver.start()","lang":"python","description":"Basic usage enabling reflection on a gRPC server. Ensure grpcio-reflection is installed."},"warnings":[{"fix":"Run 'pip install grpcio-reflection' alongside this stubs package.","message":"This is a stub package providing type hints only. It does not include the runtime implementation. You must still install 'grpcio-reflection' separately.","severity":"gotcha","affected_versions":"all"},{"fix":"Use 'grpc_reflection.v1' instead of 'grpc_reflection.v1alpha' where possible.","message":"The v1alpha reflection API is deprecated in newer versions of grpcio-reflection; prefer v1.","severity":"deprecated","affected_versions":">=1.0.0.20260408"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Import from the top-level module: 'from grpc_reflection.v1alpha import reflection' and access classes via reflection.","cause":"The stub exports types, but the actual runtime class may be located in a submodule. Direct import of internal symbols can fail.","error":"ImportError: cannot import name 'ProtoReflectionDescriptorDatabase' from 'grpc_reflection.v1alpha'"},{"fix":"Access the correct function or class from the module: 'from grpc_reflection.v1alpha import reflection; reflection.enable_server_reflection(...)'","cause":"Trying to call the module itself instead of a function within it. E.g., 'grpc_reflection.v1alpha()' instead of 'grpc_reflection.v1alpha.reflection.enable_server_reflection()'.","error":"TypeError: 'module' object is not callable"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}