Hi, I'm looking for where either the sort module or the sorted() function resides.
I'm thinking a module in the default folders, but have no idea where it is, or how to locate it (sorted is in the path, but I don't know how to display a parent based of its function)
Also, if this is in a module/group of built in functions, I would like to know that file aswell.
The reason is I'm trying to learn how for example sorted() works (so I could build my own instead of using the built in) for knowledge's sake. I could ask for how it works, but knowing how to find multiple functions would be better.
Thanks a bunch
-Brandon
Jadellll
0
Newbie Poster
Recommended Answers
Jump to PostFunctions sort() and sorted() reside in the core of the Python interpreter which is written in C and compiled. On Windows the Python core is for instance in the dynamic link library called python25.dll which the Python installer put into directory C:\WINDOWS\system32
Here is example of the rather slow …
Jump to PostPutting in a temporary test print line might just help you better understand what is going on ...
def bubble_sort(list1): # make true copy of list1 so there is no feedback list1 = list(list1) for i in xrange(len(list1) - 1, 0, -1): print list1 # a test …
All 6 Replies
bumsfeld
413
Nearly a Posting Virtuoso
Jadellll
0
Newbie Poster
vegaseat
1,735
DaniWeb's Hypocrite
Team Colleague
Jadellll
0
Newbie Poster
vegaseat
1,735
DaniWeb's Hypocrite
Team Colleague
Jadellll
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.