Skip to content

Query('foo').bar results in errors #117

@msiemens

Description

@msiemens

Source:

>>> from tinydb import Query
>>> Query('foo').bar

Stack trace:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\tinydb\queries.py", line 113, in __getattr__
    return Query(self._path + [item])
TypeError: cannot concatenate 'str' and 'list' objects
TypeError: Can't convert 'list' object to str implicitly

Discovered by @mikeckennedy when creating https://github.com/mikeckennedy/tinydb-sample-blog. We should really change the API here so people don't use it by accident in a way that breaks their programs.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions