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

SyntaxError when importing Document and/or FileBackend #57

Open
triitaoj opened this issue Aug 21, 2015 · 1 comment
Open

SyntaxError when importing Document and/or FileBackend #57

triitaoj opened this issue Aug 21, 2015 · 1 comment

Comments

@triitaoj
Copy link

Is blitzdb compatible with older versions of python? RHEL6 still uses version 2.6.6.

I tried to do the imports shown in https://github.com/adewes/blitzdb#user-content-examples

$ pip show blitzdb

---
Metadata-Version: 1.0
Name: blitzdb
Version: 0.2.12
Summary: A document-oriented database written purely in Python.
Home-page: https://github.com/adewes/blitzdb
Author: Andreas Dewes - 7scientists
Author-email: andreas@7scientists.com
License: MIT
Location: /usr/lib/python2.6/site-packages
Requires:
$ python -V
Python 2.6.6
$ head -2 test_blitzdb.py
from blitzdb import Document
from blitzdb import FileBackend
$ python test_blitzdb.py
Traceback (most recent call last):
  File "test_blitzdb.py", line 2, in <module>
    from blitzdb import Document
  File "/usr/lib/python2.6/site-packages/blitzdb/__init__.py", line 2, in <module>
    from .backends.file import Backend as FileBackend
  File "/usr/lib/python2.6/site-packages/blitzdb/backends/file/__init__.py", line 1, in <module>
    from blitzdb.backends.file.backend import Backend
  File "/usr/lib/python2.6/site-packages/blitzdb/backends/file/backend.py", line 13, in <module>
    from blitzdb.backends.file.index import (
  File "/usr/lib/python2.6/site-packages/blitzdb/backends/file/index.py", line 105
    self._undefined_keys = {key : True for key in undefined_values}
                                         ^
SyntaxError: invalid syntax
$
@dmytrokyrychuk
Copy link
Contributor

Python 2.6 does not support dict comprehensions. Blitzdb utilizes dict comprehensions, so it cannot be used with Python 2.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants