Code Monkey home page Code Monkey logo

Comments (5)

coleifer avatar coleifer commented on June 1, 2024

No plans for py3k at the moment. I'll update the docs.

from unqlite-python.

randomhammer avatar randomhammer commented on June 1, 2024

Thanks! Good thing I keep Python 2 around. :)

from unqlite-python.

coleifer avatar coleifer commented on June 1, 2024

Check out #16 for a pull-request that has py3k compatibility changes. Not sure yet if I'll merge it due to performance considerations, but if it proves to be just as fast, then I will probably go ahead and merge.

from unqlite-python.

coleifer avatar coleifer commented on June 1, 2024

You can always just use that guys' branch, though.

from unqlite-python.

Cito avatar Cito commented on June 1, 2024

I'm the guy with the Py 3 branch.

The problem with Python 3 is that its native strings are Unicode. UnQLite however deals only with byte strings, it does not have any concept of encoding.

So to faciliate usage in Python 3 and (also in Python 2 if you're using Unicode which you should), I decided to transparently encode/decode data on ingress/egress (using utf-8 encoding) and use the same interface for both, in a backward compatible way.

Because of this there is always an overhead of a type check.

I'm not really sure about the automatic conversion on egress. Currently I do this in Python 3, but not in Python 2. So you always get the native strings back.

If you have better ideas of dealing with the Unicode issue, let me know. Of course we could simply provide different methods or classes for bytestring and unicode, but that would be an ugly duplication of the interface and error prone for users, because they might end up calling the wrong methods.

from unqlite-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.