GithubHelp home page GithubHelp logo

diamondman / bitarray Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ilanschnell/bitarray

5.0 5.0 2.0 393 KB

efficient arrays of booleans for Python

License: Other

Makefile 0.21% Python 46.24% C 53.55%

bitarray's People

Contributors

andre-merzky avatar cgohlke avatar diamondman avatar drmaciver avatar eltoder avatar flowerhack avatar ilanschnell avatar pombredanne avatar udoprog avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bitarray's Issues

pull requests

should we ask the authors of the other pull requests to create new ones, or should we do that ourself and notify them? First way is probably cleaner, second one quicker :) So maybe ask, wait for a week, then pull over?

Coherence of the module

I write here because the original bitarray is dead ()

I know that is outside the spec but is a strange behaviour

In : bitarray([True, False])
Out: bitarray('10')

In : bitarray('1') + bitarray('0')
Out: bitarray('10')

In : bitarray('1') + True
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-93-3d90d100a032> in <module>()
----> 1 bitarray('1') + True

TypeError: could not extend bitarray

In : bitarray(True)   # here it interprets True as the integer 1  => int(True)
Out: bitarray('1')

In : bitarray(False)
Out: bitarray()

In : a = 2 * bitarray('1') + 2 * bitarray('0') + 2 * bitarray('1') + bitarray(False) + bitarray(True)
In : a
Out: bitarray('1100111')
# it misses the false because it evaluate as bitarray() -> zero length

also

a = 10 * bitarray('1')

In : a
Out: bitarray('1111111111')

In : a[5] = '0'

In : a
Out: bitarray('1111111111')

another 'strange' behaviour

a = 10 * bitarray('0')

In [116]: a
Out[116]: bitarray('0000000000')

In [117]: a[5:6] = 10 * bitarray('1')   # is normal to extend by default?? this is like an oveflow??)

In [118]: a
Out[118]: bitarray('0000011111111110000')

another thing why have a length property when you can use the buildin len() function?

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.