syntax difference

Mark Lawrence breamoreboy at gmail.com
Tue Jun 26 15:02:40 EDT 2018


On 26/06/18 12:39, Chris Angelico wrote:
> On Tue, Jun 26, 2018 at 9:30 PM, Bart <bc at freeuk.com> wrote:
>> On 19/06/2018 11:33, Steven D'Aprano wrote:
>>>
>>> On Tue, 19 Jun 2018 10:19:15 +0100, Bart wrote:
>>
>>
>>> * Integer sets (Pascal-like sets)
>>>
>>> Why do you need them if you have real sets?
>>
>>
>> I tried Python sets for the first time. They seemed workable but rather
>> clunky to set up. But here is one problem on my CPython:
>>
>>     x = set(range(10_000_000))
>>
>> This used up 460MB of RAM (the original 100M I tried exhausted the memory).
>>
>> The advantage of Pascal-style sets is that that same set will occupy only
>> 1.25MB, as it is a bit-map.
>>
>> While sets will not usually be that big, there might be lots of small sets
>> and they all add up.
> 
> Cool. Make me a bitset that can represent this Python set:
> 
> {-5, -4, 6, 10, 1.5, "spam", print}
> 
> ChrisA
> 

Please stop feeding this troll, it's getting very tedious.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence




More information about the Python-list mailing list