Marco-Sulla / python-frozendict

A simple immutable dictionary for Python
https://github.com/Marco-Sulla/python-frozendict
GNU Lesser General Public License v3.0
133 stars 16 forks source link

[BUG] support `__ror__` in C Extension #71

Open Marco-Sulla opened 1 year ago

Marco-Sulla commented 1 year ago

Current behavior:

Python 3.10.2 (tags/v3.10.2-dirty:a58ebcc701, Jan 15 2022, 19:15:56) [GCC 10.1.1 20200718] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import frozendict
>>> frozendict.c_ext
True
>>> from frozendict import frozendict as f
>>> f1 = f({1:2})
>>> {2:3} | f1
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for |: 'dict' and 'frozendict.frozendict'

Expected:

>>> {2:3} | f1
{2: 3, 1: 2}

as with pure py version.

Marco-Sulla commented 1 year ago

Sorry. Would you care to correct my clearly-uninformed guesswork?

No :D try it yourself.