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/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:5722f4e9-1a80-1314-53f5-16be98ce4c5d |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | 8BB0:AEBD:C81003:112A780:6968A559 |
| html-safe-nonce | befd171c12de35789b34aa353f5c453b0e2d7e083cf9254f9b14bfd12afa8a61 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QkIwOkFFQkQ6QzgxMDAzOjExMkE3ODA6Njk2OEE1NTkiLCJ2aXNpdG9yX2lkIjoiMzY3ODU2NDE0NDE4MTE5MjAyNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4fe2cbd7a1304b94f1908d244043091695bf4eb9c14e4624e1a641e952a9ae91 |
| hovercard-subject-tag | pull_request:253634111 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,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/checks |
| 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 | fdc7c66bd36a6c12eb8e771e806db863266e573fc299e77f27505a768d4f8a98 |
| turbo-cache-control | no-preview |
| 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 full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3223a6503d318917691422cdadfbe16cd8fb21e5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width