Python Forum
Time complexity of dict vs attributes
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Time complexity of dict vs attributes
#4
You are brilliant!
A small test:
>>> a = {'as': [1,2,3,4,5,6]}
>>> a
{'as': [1, 2, 3, 4, 5, 6]}
>>> len(a['as'])
6
>>> len(a['as'][:])
6
I will see if I can figure out on my own what happens here. The dict version is totally fast now. Thanks!
Reply


Messages In This Thread
Time complexity of dict vs attributes - by heras - Aug-23-2018, 08:12 PM
RE: Time complexity of dict vs attributes - by heras - Aug-24-2018, 09:20 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  What is the run time complexity of this code and please explain? samlee916 2 2,378 Nov-06-2020, 02:37 PM
Last Post: deanhystad
  Sort a dict in dict cherry_cherry 4 91,458 Apr-08-2020, 12:25 PM
Last Post: perfringo
  Basic Time Complexity Help Adakip 1 1,885 Aug-25-2019, 09:12 AM
Last Post: ThomasL
  [split] Time Complexity of Counting Mekire 9 7,872 Jan-10-2019, 11:09 AM
Last Post: Gribouillis
  How to calculate the mccabe complexity in module falke8? fuqianz 1 3,187 Oct-16-2017, 02:08 AM
Last Post: sparkz_alot

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020