Function objects do not define their own comparisons or rich comparisons. Instead, they inherit from type objects which implement rich comparisons based on the object’s address in memory.
So yes, it effectively uses addresses just like the built-in id() function does.
In Python 3, functions are no longer orderable.
Related Contents:
- Is there a built in function for string natural sort?
- How to keep keys/values in same order as declared?
- How can I sort a dictionary by key?
- Why does “return list.sort()” return None, not the list?
- How to sort a dataFrame in python pandas by two or more columns?
- What is the difference between `sorted(list)` vs `list.sort()`?
- how to sort pandas dataframe from one column
- How to correctly sort a string with a number inside? [duplicate]
- Python analog of PHP’s natsort function (sort a list using a “natural order” algorithm) [duplicate]
- Sort a list by multiple attributes?
- sort() and reverse() functions do not work
- How do I sort unicode strings alphabetically in Python?
- pandas groupby sort within groups
- sort csv by column
- Scrapy Crawl URLs in Order
- Why is Bubble Sort implementation looping forever?
- How to sort a list by length of string followed by alphabetical order?
- heapq with custom compare predicate
- How to sort and remove duplicates from Python list? [duplicate]
- Accessing the list while being sorted
- How can I “zip sort” parallel numpy arrays?
- Naturally sorting Pandas DataFrame
- Custom Python list sorting
- Sorting a dictionary by value then key
- Python sorting by multiple criteria
- List sorting with multiple attributes and mixed order
- Sorting a dictionary with lists as values, according to an element from the list
- Insert an item into sorted list in Python
- How can I reorder a list? [closed]
- How to sort OrderedDict of OrderedDict?
- Sort a part of a list in place
- Sorting list according to corresponding values from a parallel list [duplicate]
- How do I sort a list of objects based on an attribute of the objects?
- What algorithm does Python’s built-in sort() method use?
- Python .sort() not working as expected
- How to sort Counter by value? – python
- Mergesort with Python
- Searching a sorted list? [closed]
- Sort list of strings by a part of the string
- Find the unique values in a column and then sort them
- Sorting dictionary keys in python [duplicate]
- python, sort descending dataframe with pandas
- Sort a list with a custom order in Python
- How to sort 2d array by row in python?
- Efficiently sorting a numpy array in descending order?
- Right way to initialize an OrderedDict using its constructor such that it retains order of initial data?
- Sort array’s rows by another array in Python
- Sorting by absolute value without changing the data
- Sort a list of tuples by second value, reverse=True and then by key, reverse=False
- How to sort a list of dictionaries by a value of the dictionary in Python?