Title: Display the correct signature for a decorated function in Python 3 by bfrascher · Pull Request #765 · bpython/bpython · GitHub
Open Graph Title: Display the correct signature for a decorated function in Python 3 by bfrascher · Pull Request #765 · bpython/bpython
X Title: Display the correct signature for a decorated function in Python 3 by bfrascher · Pull Request #765 · bpython/bpython
Description: This patch changes it so that inspect.signature is used instead of inspect.getfullargspec to get a function's signature, when using Python 3. Python 3.3 introduced the inspect.signature function as a new way to get the signature of a function (as an alternative to inspect.getargspec and inspect.getfullargspec). inspect.signature has the advantage that it preserves the signature of a decorated function if functools.wraps is used to decorated the wrapper function. Having a function's signature available is very hepful, especially when testing things out in a REPL. The below images show the change in action (first the old behavior, then the new one): I was only able to test the changes on Python 3.7.2, but since all used functionality is available since Python 3.3 (and I only touch code paths used on Python 3) I don't think anything should break on other versions.
Open Graph Description: This patch changes it so that inspect.signature is used instead of inspect.getfullargspec to get a function's signature, when using Python 3. Python 3.3 introduced the inspect.signature functio...
X Description: This patch changes it so that inspect.signature is used instead of inspect.getfullargspec to get a function's signature, when using Python 3. Python 3.3 introduced the inspect.signature fun...
Opengraph URL: https://github.com/bpython/bpython/pull/765
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:b4a5357b-b8a2-44b0-0d96-8ba43e59e5d2 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 93F0:196E2B:11DBEF3:1949AA8:6967807E |
| html-safe-nonce | 4e38d71d7949e0fc26c74fd945f842e1b19976a975901c086aae9ff1a597ad0b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5M0YwOjE5NkUyQjoxMURCRUYzOjE5NDlBQTg6Njk2NzgwN0UiLCJ2aXNpdG9yX2lkIjoiNjUzNjkyOTI3ODQwODc1MzI3OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b92704676f7b7bac24b99f64296fd44859eebfe5010cbfea98febc32ab1abc85 |
| hovercard-subject-tag | pull_request:253634111 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/bpython/bpython/pull/765/files |
| twitter:image | https://avatars.githubusercontent.com/u/6815085?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/6815085?s=400&v=4 |
| og:image:alt | This patch changes it so that inspect.signature is used instead of inspect.getfullargspec to get a function's signature, when using Python 3. Python 3.3 introduced the inspect.signature functio... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 8476b512fc7cc2cd50b0508d9a12a3288bc58dffb7a06deab34bddef7401f352 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/bpython/bpython git https://github.com/bpython/bpython.git |
| octolytics-dimension-user_id | 8071396 |
| octolytics-dimension-user_login | bpython |
| octolytics-dimension-repository_id | 21508865 |
| octolytics-dimension-repository_nwo | bpython/bpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 21508865 |
| octolytics-dimension-repository_network_root_nwo | bpython/bpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 85da8b412065ebc20dcc2153be541687b12f6e38 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width