{"id":24782,"library":"undecorated","title":"undecorated","description":"A library to undecorate Python functions, methods, or classes, returning the original callable before any decorators were applied. Version 0.3.0 is the latest; the project is in maintenance mode with no recent releases.","status":"maintenance","version":"0.3.0","language":"python","source_language":"en","source_url":"https://github.com/mapleoin/undecorated","tags":["decorator","undecorate","reflection","utility"],"install":[{"cmd":"pip install undecorated","lang":"bash","label":"pip install"}],"dependencies":[],"imports":[{"wrong":"from undecorated import undecorate","symbol":"undecorated","correct":"from undecorated import undecorated"}],"quickstart":{"code":"from undecorated import undecorate\n\ndef decorator(func):\n    def wrapper(*args, **kwargs):\n        return func(*args, **kwargs)\n    return wrapper\n\n@decorator\ndef foo():\n    return 'foo'\n\nprint(foo())            # calls wrapper\nprint(undecorate(foo))  # returns original function\nprint(undecorate(foo)()) # 'foo'","lang":"python","description":"Basic usage: undecorate a decorated function to get the original."},"warnings":[{"fix":"Check the result; if the original function isn't found, consider alternative approaches like storing the original manually.","message":"undecorate() works by inspecting closure cells, which may fail for complex decorators (e.g., functools.lru_cache, class-based decorators, or decorators that return a different type).","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Verify the function is actually decorated before undecorating to avoid logic errors.","message":"Applying undecorate to an already undecorated function returns the same function; it does not error. This can mask misuses.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Test on your Python version; if it fails, consider forking or using an alternative library.","message":"Does not support Python 3.12+ if decorators use new closure behavior or PEP 695 (type parameter syntax) changes. The package has not been updated for recent CPython internals.","severity":"gotcha","affected_versions":">=0.3.0"}],"env_vars":null,"search_vec":"'0.3.0':21 'appli':19 'callabl':14 'class':10 'decor':17,35 'function':7 'latest':24 'librari':3 'mainten':29 'method':8 'mode':30 'origin':13 'project':26 'python':6 'recent':33 'reflect':37 'releas':34 'return':11 'undecor':1,5,36 'util':38 'version':20","created_at":"2026-05-01T08:14:53.672683+00:00","updated_at":"2026-05-01T08:14:53.672683+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.3.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/mapleoin/undecorated","docs":null,"changelog":null,"pypi":"https://pypi.org/project/undecorated/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":null}}