Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing class PyMemcacheCache in core/cache/backends/memcached.pyi #1284

Closed
skrese opened this issue Dec 6, 2022 · 1 comment · Fixed by #1314
Closed

Missing class PyMemcacheCache in core/cache/backends/memcached.pyi #1284

skrese opened this issue Dec 6, 2022 · 1 comment · Fixed by #1314
Labels
bug Something isn't working good first issue Good for newcomers stubs Issues in stubs files (.pyi)

Comments

@skrese
Copy link

skrese commented Dec 6, 2022

Bug report

What's wrong

In Django 3.2+ source code in core/cache/backends/memcached.py there's:

class PyMemcacheCache(BaseMemcachedCache):
    """An implementation of a cache binding using pymemcache."""
    def __init__(self, server, params):
        import pymemcache.serde
        super().__init__(server, params, library=pymemcache, value_not_found_exception=KeyError)
        self._class = self._lib.HashClient
        self._options = {
            'allow_unicode_keys': True,
            'default_noreply': False,
            'serde': pymemcache.serde.pickle_serde,
            **self._options,
        }

but in stubs in core/cache/backends/memcached.pyi there is no stub for PyMemcacheCache.

How is that should be

I believe the missing part in core/cache/backends/memcached.pyi is:

class PyMemcacheCache(BaseMemcachedCache):
    def __init__(self, server: Union[str, Sequence[str]], params: Dict[str, Any]) -> None: ...

System information

  • OS:
  • python version: 3.8.13
  • django version: 3.2.16
  • mypy version: 0.991
  • django-stubs version: 1.13.0
  • django-stubs-ext version: 0.7.0
@skrese skrese added the bug Something isn't working label Dec 6, 2022
@intgr intgr added good first issue Good for newcomers stubs Issues in stubs files (.pyi) labels Dec 6, 2022
ngnpope added a commit to ngnpope/django-stubs that referenced this issue Jan 9, 2023
@skrese
Copy link
Author

skrese commented Jan 9, 2023

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers stubs Issues in stubs files (.pyi)
Development

Successfully merging a pull request may close this issue.

2 participants