youknowone / ring

Python cache interface with clean API and built-in memcache & redis + asyncio support.
http://ring-cache.readthedocs.io/en/latest/
Other
480 stars 37 forks source link

TypeError when using positional-only parameters #192

Closed nonamethanks closed 1 year ago

nonamethanks commented 1 year ago
import ring 

class Klass1:
    def __str__(self):
        return "Klass1<>"

    @ring.lru() 
    def test1(self, **kwargs):
        print(kwargs)

class Klass2:
    def __str__(self):
        return "Klass2<>"

    @ring.lru()
    def test2(self, /, **kwargs):
        print(kwargs)

Klass1().test1(a=2, b=3)
Klass2().test2(a=2, b=3)

Klass1.test1 works, but Klass2.test2 fails. The two functions are identical save for the presence of the slash, which is the positional-only delimiter.

youknowone commented 1 year ago

0.10.1 is released with bugfix. Thank you for reporting!

https://pypi.org/project/ring/0.10.1/