Re: [BangPypers] Reorder Dictionary Size in python

2013-04-17 Thread Hrishikesh Kulkarni
On Wed, Apr 17, 2013 at 9:30 PM, Rahul R wrote: > As far as i know, python performs a lazy deletion of values , when we > delete content from a dictionary (correct me if i am wrong) . So, when we > insert a lot of values the dictionary automatically expands. I don't see > dict shrinking when we

Re: [BangPypers] Reorder Dictionary Size in python

2013-04-17 Thread Hrishikesh Kulkarni
Rahul, Get the source code of Python http://www.python.org/download/releases/ Search for the implementation of dictionary. I believe it should be Objects/dictobject.c Now you should be able to try out what you want. Python core developers maybe smarter but that is no good reason to not try out i

Re: [BangPypers] Reorder Dictionary Size in python

2013-04-17 Thread Noufal Ibrahim
Noufal Ibrahim writes: > Rahul R writes: > >> I dont intent to pre optimize things , I am rather driven by curiosity on >> how one could do that. > > I'm with Anand on recommendations but like you, I'm curious as to > whether this is possible. Do you have some estimates of size for your > dicti

Re: [BangPypers] Reorder Dictionary Size in python

2013-04-17 Thread Anand B Pillai
On Thu, Apr 18, 2013 at 10:54 AM, Noufal Ibrahim wrote: > Rahul R writes: > > > I dont intent to pre optimize things , I am rather driven by curiosity > on > > how one could do that. > > I'm with Anand on recommendations but like you, I'm curious as to > whether this is possible. Do you have som

Re: [BangPypers] Reorder Dictionary Size in python

2013-04-17 Thread Noufal Ibrahim
Rahul R writes: > I dont intent to pre optimize things , I am rather driven by curiosity on > how one could do that. I'm with Anand on recommendations but like you, I'm curious as to whether this is possible. Do you have some estimates of size for your dictionary and the average size for the va

Re: [BangPypers] Reorder Dictionary Size in python

2013-04-17 Thread Rahul R
As far as i know , gc.collect() works on objects which are not used anymore. Not for resizing existing objects. Thanks, ./Rahul On Thu, Apr 18, 2013 at 9:25 AM, Abdul Muneer wrote: > Expecting this behaviour from built-in dict is not a good idea. However try > if garbage collection helps. > >>>

Re: [BangPypers] Reorder Dictionary Size in python

2013-04-17 Thread Rahul R
I dont intent to pre optimize things , I am rather driven by curiosity on how one could do that. Thanks, ./Rahul On Thu, Apr 18, 2013 at 5:53 AM, Anand Chitipothu wrote: > On Wed, Apr 17, 2013 at 9:30 PM, Rahul R wrote: > > > As far as i know, python performs a lazy deletion of values , when w

Re: [BangPypers] Reorder Dictionary Size in python

2013-04-17 Thread Abdul Muneer
Expecting this behaviour from built-in dict is not a good idea. However try if garbage collection helps. >>> import gc >>> gc.collect() I have not tried it out myself, though. Regards, Abdul Muneer -- Follow me on Twitter: @abdulmuneer On Thu, Apr 18, 2013

Re: [BangPypers] Reorder Dictionary Size in python

2013-04-17 Thread Anand Chitipothu
On Wed, Apr 17, 2013 at 9:30 PM, Rahul R wrote: > As far as i know, python performs a lazy deletion of values , when we > delete content from a dictionary (correct me if i am wrong) . So, when we > insert a lot of values the dictionary automatically expands. I don't see > dict shrinking when we

Re: [BangPypers] Reorder Dictionary Size in python

2013-04-17 Thread Rahul R
As far as i know, python performs a lazy deletion of values , when we delete content from a dictionary (correct me if i am wrong) . So, when we insert a lot of values the dictionary automatically expands. I don't see dict shrinking when we delete values from dictionary. In such case, is there a wa

Re: [BangPypers] Reorder Dictionary Size in python

2013-04-17 Thread Ramdas S
On Wed, Apr 17, 2013 at 9:22 PM, Rahul R wrote: > Ahh , sorry If i wasnt clear the first time. I dint mean reorder the data > in dictionary. I meant resize the dictionary. > What do you mean by resize? > > ./Rahul > > On Wed, Apr 17, 2013 at 9:05 PM, Anand Chitipothu >wrote: > > > dictionarie

Re: [BangPypers] Reorder Dictionary Size in python

2013-04-17 Thread Rahul R
Ahh , sorry If i wasnt clear the first time. I dint mean reorder the data in dictionary. I meant resize the dictionary. ./Rahul On Wed, Apr 17, 2013 at 9:05 PM, Anand Chitipothu wrote: > dictionaries are unordered. It is not a good idea to expect any order in > dictionaries, even if you are seei

Re: [BangPypers] Reorder Dictionary Size in python

2013-04-17 Thread Anand Chitipothu
dictionaries are unordered. It is not a good idea to expect any order in dictionaries, even if you are seeing some order by chance. If you need order, then use OrderedDict from collections module (new in Python 2.7). Anand On Wed, Apr 17, 2013 at 9:00 PM, Rahul R wrote: > Hey Guys, > > Is it

[BangPypers] Reorder Dictionary Size in python

2013-04-17 Thread Rahul R
Hey Guys, Is it possible to forcibly reorder the python dictionary after "n" number of inserts and deletions. As far as i know, python dictionary performs lazy deletes. Thus , even if the data is deleted, python has a dummy data their in order to preserve consistency. The python dictionary keeps

Re: [BangPypers] April month meetup

2013-04-17 Thread Baiju M
Yes, I confirm this venue. This is the address: ZeOmega Infotech Pvt. Ltd. "Subhashri Pride", 4th Floor, Southend Road, Basavanagudi, Bangalore-560-004 (Just look for "Axis Bank", it's the same building) My mobile number: 9945973441 On Wed, Apr 17, 2013 at 2:38 PM, Anand Chitipothu wrote: > K

Re: [BangPypers] April month meetup

2013-04-17 Thread Anand Chitipothu
Krace is out of town. I've asked Baiju if he can coordinate the meetup at ZeOmega. He said he'll find someone to coordinate the event there. So we have Zeomega as tentative venue. Lets wait for a final confirmation from Baiju. Tentative Venue: ZeOmega, Basavanagudi Date: Saturday, April 20, 2013