[issue45288] Inspect - Added sort_result parameter on getmembers function.

2021-10-01 Thread Terry J. Reedy
Change by Terry J. Reedy : -- resolution: -> rejected stage: -> resolved status: open -> closed type: -> enhancement versions: +Python 3.11 -Python 3.8 ___ Python tracker

[issue45288] Inspect - Added sort_result parameter on getmembers function.

2021-09-27 Thread Cristobal Riaga
Cristobal Riaga added the comment: That worked , thank you for your time and answer. I will keep working on PyAPIReference. Also I will close the pull request I created on GitHub. -- ___ Python tracker

[issue45288] Inspect - Added sort_result parameter on getmembers function.

2021-09-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ah, if you only need a module, then just use its __dict__ (or vars()). -- ___ Python tracker ___

[issue45288] Inspect - Added sort_result parameter on getmembers function.

2021-09-27 Thread Cristobal Riaga
Cristobal Riaga added the comment: I'm don't really need inherit order, neither built-in members. e.g.: ```py a = 3 # First class B: # Second pass def foo(): # Third pass ``` Or in a more complex module: ```py class A: # First pass class B: # Second pass class C(A, B): #

[issue45288] Inspect - Added sort_result parameter on getmembers function.

2021-09-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It depends on what you want to get. In general, it is difficult if interpret your request literally. For example, if you define class A in module a, class B in module b, and class C which inherits from classes A and B in module c, then what members of C

[issue45288] Inspect - Added sort_result parameter on getmembers function.

2021-09-26 Thread Cristobal Riaga
Cristobal Riaga added the comment: So there is no way to get members in the order you defined them? -- ___ Python tracker ___ ___

[issue45288] Inspect - Added sort_result parameter on getmembers function.

2021-09-26 Thread Cristobal Riaga
Cristobal Riaga added the comment: So there is no way to get the members in order? -- ___ Python tracker ___ ___ Python-bugs-list

[issue45288] Inspect - Added sort_result parameter on getmembers function.

2021-09-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: But you will not get them in creation order, even if omit the final sort, because: 1. dir() returns names sorted alphabetically, not in order of creation. 2. Dynamic class attributes are added at the end, and inherited attributes follow attributes defined

[issue45288] Inspect - Added sort_result parameter on getmembers function.

2021-09-25 Thread Cristobal Riaga
Cristobal Riaga added the comment: Added sort_result parameter (bool=True) on getmembers function inside Lib/inspect.py, that, as it name says, allows you to getmembers result without sorting it. I'm needed of this and it seems impossible to achieve because of 367 line:

[issue45288] Inspect - Added sort_result parameter on getmembers function.

2021-09-25 Thread Cristobal Riaga
New submission from Cristobal Riaga : Added `sort_result` parameter (`bool=True`) on `getmembers` function inside `Lib/inspect.py`, that, as it name says, allows you to `getmembers` result without sorting it. I'm needed of this and it seems impossible to achieve because of [`367`