Re: deque as default list behaviour

2019-03-03 Thread Chris Angelico
On Sun, Mar 3, 2019 at 10:12 PM Abdur-Rahmaan Janhangeer wrote: > > i can be wrong but i guess that inserting at the begining does not cause > troubles as insertion at index 0 is constant (time does not scale with number > of data) > In a deque? Correct. But the price of that is reduced efficie

Re: deque as default list behaviour

2019-03-03 Thread Abdur-Rahmaan Janhangeer
i can be wrong but i guess that inserting at the begining does not cause troubles as insertion at index 0 is constant (time does not scale with number of data) Abdur-Rahmaan Janhangeer http://www.pythonmembers.club | https://github.com/Abdur-rahmaanJ Mauritius -- https://mail.python.org/mailman/l

Re: deque as default list behaviour

2019-03-02 Thread Chris Angelico
On Sun, Mar 3, 2019 at 6:17 PM Abdur-Rahmaan Janhangeer wrote: > > simple question; why does the normal list not exhibit a deque behaviour > (left insertion)? Because it's a lot less efficient. If you want that behaviour, you CAN still insert into a list at position zero, but it's going to be slo

deque as default list behaviour

2019-03-02 Thread Abdur-Rahmaan Janhangeer
simple question; why does the normal list not exhibit a deque behaviour (left insertion)? -- Abdur-Rahmaan Janhangeer http://www.pythonmembers.club | https://github.com/Abdur-rahmaanJ Mauritius -- https://mail.python.org/mailman/listinfo/python-list