[issue20827] IDLE : Display function argument list in ClassBrowser

Saimadhav Heblikar report at bugs.python.org
Sun Mar 16 14:22:13 CET 2014


Saimadhav Heblikar added the comment:

I have added a improved patch.
What this patch does:

1. resolves issue 1 of msg213193 - uses inspect. signature() instead of inspect.getargspec. 

2. resolves issue 2 of msg213193 - the module is imported only once per ClassBrowser instance.

3. resolves issue 2 of msg213333 - the classbrowser display is based on the current EditorWindow text and not based on whats on disk. All changes to reflect this have been made in ClassBrowser.py and pyclbr, therefore i did not create a new issue.

4. resolves issue 1 of msg213333 - though i feel there are better ways to do this than this patch - which manually close and create a new ClassBrowser instance


what this patch does NOT do:

1. the test_pyclbr fails after the proposed changes to pyclbr,(which is just adding a new keyword argument to _readmodule,readmodule_ex. i have circled it down to this.
the only other change to pyclbr is an extra "if" statement.)
i have tried to modify the tests to reflect the same, but to no avail. if you can give me some hints on how to move forward, i'll be quick to implement the tests.
here is the test error ->

test_decorators (test.test_pyclbr.PyclbrTest) ... *** B
FAIL
test_easy (test.test_pyclbr.PyclbrTest) ... ok
test_issue_14798 (test.test_pyclbr.PyclbrTest) ... ok
test_others (test.test_pyclbr.PyclbrTest) ... *** BytesHeaderParser
FAIL

======================================================================
FAIL: test_decorators (test.test_pyclbr.PyclbrTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/media/development/cpython/Lib/test/test_pyclbr.py", line 152, in test_decorators
    self.checkModule('test.pyclbr_input', ignore=['om'])
  File "/media/development/cpython/Lib/test/test_pyclbr.py", line 139, in checkModule
    self.assertHaskey(dict, name, ignore)
  File "/media/development/cpython/Lib/test/test_pyclbr.py", line 43, in assertHaskey
    self.assertIn(key, obj)
AssertionError: 'B' not found in {}

======================================================================
FAIL: test_others (test.test_pyclbr.PyclbrTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/media/development/cpython/Lib/test/test_pyclbr.py", line 167, in test_others
    cm('email.parser')
  File "/media/development/cpython/Lib/test/test_pyclbr.py", line 139, in checkModule
    self.assertHaskey(dict, name, ignore)
  File "/media/development/cpython/Lib/test/test_pyclbr.py", line 43, in assertHaskey
    self.assertIn(key, obj)
AssertionError: 'BytesHeaderParser' not found in {}

----------------------------------------------------------------------
Ran 4 tests in 15.437s

----------
Added file: http://bugs.python.org/file34439/classbrowser-improvements-v2.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20827>
_______________________________________


More information about the Python-bugs-list mailing list