Title: Unexpected parsing behaviour for --date=2018-12-09 vs. --date=2018-12-10 · Issue #102 · google/python-fire · GitHub
Open Graph Title: Unexpected parsing behaviour for --date=2018-12-09 vs. --date=2018-12-10 · Issue #102 · google/python-fire
X Title: Unexpected parsing behaviour for --date=2018-12-09 vs. --date=2018-12-10 · Issue #102 · google/python-fire
Description: Anything that can be interpreted as an arithmetics expression will be magically "calculated" by fire. This is very practical. But it bit me because I wanted to parse dates from command line parameters using fire, see below. Suggestion: a...
Open Graph Description: Anything that can be interpreted as an arithmetics expression will be magically "calculated" by fire. This is very practical. But it bit me because I wanted to parse dates from command line paramet...
X Description: Anything that can be interpreted as an arithmetics expression will be magically "calculated" by fire. This is very practical. But it bit me because I wanted to parse dates from command li...
Opengraph URL: https://github.com/google/python-fire/issues/102
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unexpected parsing behaviour for --date=2018-12-09 vs. --date=2018-12-10","articleBody":"Anything that can be interpreted as an arithmetics expression will be magically \"calculated\" by fire. This is very practical. But it bit me because I wanted to parse dates from command line parameters using fire, see below. \r\n\r\nSuggestion: accept type hints as a way to prevent this. A parameter with type hint \"str\" shoud not be \"calculated\". \r\n\r\nTest code:\r\n\r\n```import fire\r\n\r\ndef test(string: str=None) :\r\n print(string)\r\n\r\nif __name__==\"__main__\" :\r\n fire.Fire(test)\r\n```\r\n\r\nWill give you: \r\n\r\n```\r\n> python ./test-parsing.py --string=2010-10-10\r\n1990 # not interpreted as a string, but as 2010 minus 10 minus 10\r\n\r\n> python ./test-parsing.py --string=2010-10-09\r\n2010-10-09\r\n\r\n```","author":{"url":"https://github.com/martinvirtel","@type":"Person","name":"martinvirtel"},"datePublished":"2017-11-28T14:31:11Z","url":"https://github.com/google/python-fire/issues/102"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5abe8565-e731-9ff9-a376-6bf0b957cb29 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A870:B1603:30291D7:3FBCA2A:6B002B75 |
| html-safe-nonce | 408e482b188198d8a4bf791fe561817d63476949dd4c6165872087955ee85374 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBODcwOkIxNjAzOjMwMjkxRDc6M0ZCQ0EyQTo2QjAwMkI3NSIsInZpc2l0b3JfaWQiOiI3ODM3MjkzODIzNDQ4MzI5MDc3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 97d4b9166e3d27602be704f73a629fe2bcc10bdeaff7ff834b608232cd219dae |
| hovercard-subject-tag | issue:277405171 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/google/python-fire/102/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c5bfd9fa027f96dbca6c73b8e76865456dadd0ad28bb2ba2e3474c13413023f9/google/python-fire/issues/102 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c5bfd9fa027f96dbca6c73b8e76865456dadd0ad28bb2ba2e3474c13413023f9/google/python-fire/issues/102 |
| og:image:alt | Anything that can be interpreted as an arithmetics expression will be magically "calculated" by fire. This is very practical. But it bit me because I wanted to parse dates from command line paramet... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | martinvirtel |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/google/python-fire git https://github.com/google/python-fire.git |
| octolytics-dimension-user_id | 1342004 |
| octolytics-dimension-user_login | |
| octolytics-dimension-repository_id | 82729529 |
| octolytics-dimension-repository_nwo | google/python-fire |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 82729529 |
| octolytics-dimension-repository_network_root_nwo | google/python-fire |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width