# types-singleton-decorator
Type stubs for the `singleton_decorator` package to provide proper type hints and fix Pylance type checking issues.
## Problem Solved
When using the `singleton_decorator` decorator, Pylance shows the error:
```
Expected class but received "_SingletonWrapper" PylancereportGeneralTypeIssues
```
This package provides proper type stubs to resolve this issue and ensure your IDE understands that decorated classes remain classes.
## Installation
Install using pip:
```bash
pip install types-singleton-decorator
```
Or using uv:
```bash
uv add types-singleton-decorator
```
## Usage
Once installed, the type stubs will automatically be picked up by your type checker (Pylance, mypy, etc.). No additional configuration is needed.
Your singleton decorators will now have proper type support:
```python
from singleton_decorator import singleton
@singleton
class MyClass:
def __init__(self, value: str):
self.value = value
def get_value(self) -> str:
return self.value
# This will now have proper type hints
instance = MyClass("hello") # Type: MyClass, not _SingletonWrapper
print(instance.get_value()) # Pylance understands this method exists
```
## What's Included
This package provides type stubs for:
- `@singleton` decorator
- `SingletonMeta` metaclass (if used)
- Proper preservation of class types and methods
## Requirements
- Python >= 3.8
- The original `singleton_decorator` package
## Contributing
Issues and pull requests are welcome at the [GitHub repository](https://github.com/rohitshubham/types-singleton-decorator).
## License
MIT License
Raw data
{
"_id": null,
"home_page": null,
"name": "types-singleton-decorator",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "decorator, singleton, stubs, typing",
"author": "Rohit Raj",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/1d/49/2f0a6d450cb7f881c8f1e1d7c4ee306e6100b1062200f65be11beb490218/types_singleton_decorator-0.1.0.tar.gz",
"platform": null,
"description": "# types-singleton-decorator\n\nType stubs for the `singleton_decorator` package to provide proper type hints and fix Pylance type checking issues.\n\n## Problem Solved\n\nWhen using the `singleton_decorator` decorator, Pylance shows the error:\n```\nExpected class but received \"_SingletonWrapper\" PylancereportGeneralTypeIssues\n```\n\nThis package provides proper type stubs to resolve this issue and ensure your IDE understands that decorated classes remain classes.\n\n## Installation\n\nInstall using pip:\n```bash\npip install types-singleton-decorator\n```\n\nOr using uv:\n```bash\nuv add types-singleton-decorator\n```\n\n## Usage\n\nOnce installed, the type stubs will automatically be picked up by your type checker (Pylance, mypy, etc.). No additional configuration is needed.\n\nYour singleton decorators will now have proper type support:\n\n```python\nfrom singleton_decorator import singleton\n\n@singleton\nclass MyClass:\n def __init__(self, value: str):\n self.value = value\n \n def get_value(self) -> str:\n return self.value\n\n# This will now have proper type hints\ninstance = MyClass(\"hello\") # Type: MyClass, not _SingletonWrapper\nprint(instance.get_value()) # Pylance understands this method exists\n```\n\n## What's Included\n\nThis package provides type stubs for:\n- `@singleton` decorator\n- `SingletonMeta` metaclass (if used)\n- Proper preservation of class types and methods\n\n## Requirements\n\n- Python >= 3.8\n- The original `singleton_decorator` package \n\n## Contributing\n\nIssues and pull requests are welcome at the [GitHub repository](https://github.com/rohitshubham/types-singleton-decorator).\n\n## License\n\nMIT License\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Type stubs for singleton_decorator",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/rohitshubham/types-singleton-decorator",
"Issues": "https://github.com/rohitshubham/types-singleton-decorator/issues",
"Repository": "https://github.com/rohitshubham/types-singleton-decorator"
},
"split_keywords": [
"decorator",
" singleton",
" stubs",
" typing"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "4cf0d7048b34c88f59f622087f6d9edd47c95235136a4ae03dfbad361c6e335a",
"md5": "38eff2348235e7e40e6a6425e2eb4698",
"sha256": "1cb2b28c22546871f0ec624fb13b168d8628460c1d5f37dde960b582a44016ff"
},
"downloads": -1,
"filename": "types_singleton_decorator-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "38eff2348235e7e40e6a6425e2eb4698",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 3565,
"upload_time": "2025-09-02T11:56:19",
"upload_time_iso_8601": "2025-09-02T11:56:19.365856Z",
"url": "https://files.pythonhosted.org/packages/4c/f0/d7048b34c88f59f622087f6d9edd47c95235136a4ae03dfbad361c6e335a/types_singleton_decorator-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "1d492f0a6d450cb7f881c8f1e1d7c4ee306e6100b1062200f65be11beb490218",
"md5": "cf22ea1dbe71d981f245de65cadc8355",
"sha256": "187909facd76949d88711c3dc80a81170cca23a08adf943f99dba3839ce7f6a4"
},
"downloads": -1,
"filename": "types_singleton_decorator-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "cf22ea1dbe71d981f245de65cadc8355",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 3049,
"upload_time": "2025-09-02T11:56:20",
"upload_time_iso_8601": "2025-09-02T11:56:20.525643Z",
"url": "https://files.pythonhosted.org/packages/1d/49/2f0a6d450cb7f881c8f1e1d7c4ee306e6100b1062200f65be11beb490218/types_singleton_decorator-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-02 11:56:20",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rohitshubham",
"github_project": "types-singleton-decorator",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "types-singleton-decorator"
}