Opened 8 years ago
Closed 8 years ago
#18249 closed defect (fixed)
Introspection for builtin functions
Reported by: | SimonKing | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-6.7 |
Component: | misc | Keywords: | |
Cc: | Merged in: | ||
Authors: | Simon King | Reviewers: | Volker Braun |
Report Upstream: | N/A | Work issues: | |
Branch: | e478d5b (Commits, GitHub, GitLab) | Commit: | e478d5b842268da0314778105e6801f316d7070c |
Dependencies: | #17814 | Stopgaps: |
Description (last modified by )
Up to now, the attempt to inspect Python builtins with ?
results in a TypeError
, raised by Python's inspect module. This is when the argspec or the source file is requested.
I suggest to return generic information. With the attached branch, we get
sage: range? Docstring: range(stop) -> list of integers range(start, stop[, step]) -> list of integers Return a list containing an arithmetic progression of integers. range(i, j) returns [i, i+1, i+2, ..., j-1]; start (!) defaults to 0. When step is given, it specifies the increment (or decrement). For example, range(4) returns [0, 1, 2, 3]. The end point is omitted! These are exactly the valid indices for a list of 4 elements. Init docstring: x.__init__(...) initializes x; see help(type(x)) for signature File: Type: builtin_function_or_method
Change History (8)
comment:1 Changed 8 years ago by
Branch: | → u/SimonKing/introspection_for_builtin_functions |
---|
comment:2 Changed 8 years ago by
Authors: | → Simon King |
---|---|
Commit: | → dffa7659dc2f0129458fa7394b851fa018f91363 |
Component: | PLEASE CHANGE → misc |
Dependencies: | → #17814 |
Description: | modified (diff) |
Status: | new → needs_review |
Type: | PLEASE CHANGE → defect |
comment:3 Changed 8 years ago by
Reviewers: | → Volker Braun |
---|---|
Status: | needs_review → needs_work |
Merge conflict, can you merge in 6.7.beta3
Code looks good, set to positive review when you are done.
comment:4 Changed 8 years ago by
Can someone else please do the merge, I will be too busy till next week.
comment:5 Changed 8 years ago by
Branch: | u/SimonKing/introspection_for_builtin_functions → u/jdemeyer/introspection_for_builtin_functions |
---|
comment:6 Changed 8 years ago by
Commit: | dffa7659dc2f0129458fa7394b851fa018f91363 → e478d5b842268da0314778105e6801f316d7070c |
---|---|
Status: | needs_work → needs_review |
New commits:
e478d5b | Merge tag '6.7.beta3' into t/18249/introspection_for_builtin_functions
|
comment:7 Changed 8 years ago by
Status: | needs_review → positive_review |
---|
comment:8 Changed 8 years ago by
Branch: | u/jdemeyer/introspection_for_builtin_functions → e478d5b842268da0314778105e6801f316d7070c |
---|---|
Resolution: | → fixed |
Status: | positive_review → closed |
Note: See
TracTickets for help on using
tickets.
New commits:
Avoid source inspection for cached cython methods without arguments
Make a cached function/method work with default argspec when introspection fails
Merge branch 't/17814/make_calling_a_cached_method_independent_of_source_code_inspection' into t/17814/rebased-make_calling_a_cached_method_independent_of_source_code_inspection
Use embedded signature for introspection
Catch syntax error when extraction of signature fails
Introspection of builtins returns generic data instead of raising an error