{"categories":[{"label":"Utilities","url":"https://skillfed.io/packages/category/utilities/11"}],"enrichment":{"capability":"Provides a decorator that lets a single method behave differently when called on a class versus an instance, combining classmethod and instance method logic in one.","skillfed_tags":["decorator","method-dispatch"],"use_cases":["Factory methods that construct instances differently when called on the class versus operating on an existing instance","Dual-mode utilities where class-level calls perform setup or configuration and instance calls perform operations","Avoiding name collisions when you need both a classmethod and instance method with identical names"],"what_it_does":"mixed-methods is a small utility library that exports a single decorator, `mixed_method`, which allows you to define a method that behaves as a classmethod when called on the class itself and as an instance method when called on an instance. You pass two functions to the decorator\u2014one for class-level behavior and one for instance-level behavior\u2014and the resulting method dispatches to the appropriate implementation based on how it's invoked.\n\nThe package is typed and supports Python 3.8 and above. It has no external dependencies beyond attrs and typing-extensions, making it lightweight. The library is dormant (last updated over 900 days ago) but marked as production-stable; it solves a narrow, well-defined problem and has remained essentially unchanged since its early releases.","worth_installing":"Yes, if you specifically need a method that behaves as both classmethod and instance method. The package is lightweight, permissively licensed, and solves its narrow problem cleanly. However, dormant maintenance and minimal download volume suggest it remains a niche utility; only install if this exact pattern fits your design."},"id":"mixed-methods","links":{"html":"https://skillfed.io/packages/mixed-methods","md":"https://skillfed.io/packages/mixed-methods.md","pypi":"https://pypi.org/project/mixed-methods/"},"maintenance":{"status":"dormant"},"meta":{"latest_release":"2024-02-26","license_spdx":null,"license_treatment":"permissive","name":"mixed-methods","python_support":"supports_current","summary":"Mixed methods."},"popularity":{"monthly_downloads":77688,"position":14506,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.1.1"}
