creating very small types

andrea kerny404 at gmail.com
Wed Apr 27 18:31:16 EDT 2005


Jeremy Bowers wrote:

>On Wed, 27 Apr 2005 22:17:07 +0200, andrea wrote:
>
>  
>
>>I was thinking to code the huffman algorithm and trying to compress
>>something with it, but I've got a problem.
>>How can I represent for example a char with only 3 bits??
>>I had a look to the compression modules but I can't understand them much...
>>
>>Thank you very much
>>Any good link would be appreciated of course :)
>>    
>>
>
>I think the answer to this question very much depends on why you want to
>do this. Easy and fast are pretty opposed in this particular domain in
>Python (IMHO anyways, it's an easy bit-bashing language but it's slow
>for that), and you're in one of the rare domains where it matters.
>
>The answers strongly vary if you're trying to create something performant,
>or just for your learning purposes. Or homework purposes... ;-)
>
>  
>
No it's not for homework but for learning purposes...
I understand I can't do it easily in python, but maybe I could define a
new type in C and use it to do those dirty works, what do you think?



More information about the Python-list mailing list