question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG - Develop] Can't `|` two SaverDicts

See original GitHub issue

Describe the bug

When combining two attributes containing dict data, it fails with a traceback.

File "./TestGame/typeclasses/characters.py", line 30, in test_attr
return self.db.db_one | self.db.db_two
File "./evennia/evennia/utils/dbserialize.py", line 243, in __or__
return self._data | other
TypeError: unsupported operand type(s) for |: 'dict' and '_SaverDict

To Reproduce

Steps to reproduce the behavior:

  1. Store dicts in two attributes or attribute properties.
  2. Use the | operator on them
  3. See error

Develop-branch commit

22fa2c6b8

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
InspectorCaracalcommented, Jul 2, 2022

Oh haha I completely forgot it was so recent! I hadn’t really ever needed to combine dicts until I started messing around with splicing together prototype dicts in evennia, so it’s the syntax I learned first for it.

Anyway, the main issue is that it works fine if you combine a normal dict and a saver dict, but breaks if you use two saver dicts. It’s easy enough to work around by casting one or both to dict first so I don’t think it’s a priority, but since it tracebacked I figured I’d report it.

0reactions
Griatchcommented, Aug 2, 2022

Resolved in #2813 !

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Bug] SaverDict Saving Situation · Issue #2599 - GitHub
Basically it works fine as long as you only modify foodict or obj.db.foo but not when mixing the two. It's possible there is...
Read more >
How do you fix a bug you can't replicate? - Stack Overflow
Java. An application that has multiple threads might only show its bugs with a very specific timing or sequence of events. Improper concurrency...
Read more >
Insect Growth and Development | WSU Tree Fruit
As the insect's rigid exoskeleton cannot expand much, it must be shed and replaced with a ... This is where two or more...
Read more >
Triatomine Bug FAQs - Chagas Disease - CDC
What is a triatomine bug and what does it look like? triatomine. Various triatomine bugs in all life stages, from eggs to nymphs...
Read more >
When Treatments Don't Work | US EPA
Disregarding recommended label rates (applying pesticides at too low a rate may not kill bugs and may speed up development of resistance to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found