From 539f5452c50fc59c094a486832ec960f782354d1 Mon Sep 17 00:00:00 2001 From: Christian Ledermann Date: Sun, 17 Nov 2024 18:52:31 +0000 Subject: [PATCH] enhance documentation for Registry class usage and its singleton pattern --- fastkml/registry.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fastkml/registry.py b/fastkml/registry.py index 505cb929..96e53bb1 100644 --- a/fastkml/registry.py +++ b/fastkml/registry.py @@ -20,6 +20,14 @@ This approach allows for flexible, declarative mapping between XML and Python objects, with the registry acting as a central configuration for these mappings. +Direct ``Registry`` class use is typically only for library internals or advanced +customization. For normal usage, stick with the ``registry`` instance: + +- The library is designed around this global instance. +- Ensures all parts of the library use the same registry. +- Pre-populated with standard KML mappings. +- Singleton pattern: Avoids multiple conflicting registries. + """ from dataclasses import dataclass @@ -116,14 +124,6 @@ class Registry: - Enable consistent handling of attributes across different KML classes. - Facilitate extensibility and maintainability of the library. - Direct ``Registry`` class use is typically only for library internals or advanced - customization. For normal usage, stick with the ``registry`` instance: - - - The library is designed around this global instance. - - Ensures all parts of the library use the same registry. - - Pre-populated with standard KML mappings. - - Singleton pattern: Avoids multiple conflicting registries. - """ _registry: Dict[Type["_XMLObject"], List[RegistryItem]]