{"action":"created","issue":{"url":"https://api.github.com/repos/mitsuhiko/click/issues/383","labels_url":"https://api.github.com/repos/mitsuhiko/click/issues/383/labels{/name}","comments_url":"https://api.github.com/repos/mitsuhiko/click/issues/383/comments","events_url":"https://api.github.com/repos/mitsuhiko/click/issues/383/events","html_url":"https://github.com/mitsuhiko/click/issues/383","id":95863742,"number":383,"title":"click.IntRange() silently fails when non-int min/max are used.","user":{"login":"geowurster","id":2676083,"avatar_url":"https://avatars.githubusercontent.com/u/2676083?v=3","gravatar_id":"","url":"https://api.github.com/users/geowurster","html_url":"https://github.com/geowurster","followers_url":"https://api.github.com/users/geowurster/followers","following_url":"https://api.github.com/users/geowurster/following{/other_user}","gists_url":"https://api.github.com/users/geowurster/gists{/gist_id}","starred_url":"https://api.github.com/users/geowurster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geowurster/subscriptions","organizations_url":"https://api.github.com/users/geowurster/orgs","repos_url":"https://api.github.com/users/geowurster/repos","events_url":"https://api.github.com/users/geowurster/events{/privacy}","received_events_url":"https://api.github.com/users/geowurster/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mitsuhiko/click/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-18T22:10:05Z","updated_at":"2015-07-19T21:38:21Z","closed_at":"2015-07-19T21:38:21Z","body":"In this case `cpu_count()` isn't called so `click.IntRange()` receives a function rather than a value and the min/max validation is silently ignored.\r\n\r\n```python\r\nfrom multiprocessing import cpu_count\r\n\r\nimport click\r\n\r\n@click.command()\r\n@click.option(\r\n    '-j', '--jobs', metavar='CORES', type=click.IntRange(min=1, max=cpu_count), default=1,\r\n    show_default=True, help=\"Process data across N cores.\"\r\n)\r\ndef cli(jobs):\r\n    \"\"\"Jobs\"\"\"\r\n\r\n    click.echo(jobs)\r\n```"},"comment":{"url":"https://api.github.com/repos/mitsuhiko/click/issues/comments/122708456","html_url":"https://github.com/mitsuhiko/click/issues/383#issuecomment-122708456","issue_url":"https://api.github.com/repos/mitsuhiko/click/issues/383","id":122708456,"user":{"login":"mitsuhiko","id":7396,"avatar_url":"https://avatars.githubusercontent.com/u/7396?v=3","gravatar_id":"","url":"https://api.github.com/users/mitsuhiko","html_url":"https://github.com/mitsuhiko","followers_url":"https://api.github.com/users/mitsuhiko/followers","following_url":"https://api.github.com/users/mitsuhiko/following{/other_user}","gists_url":"https://api.github.com/users/mitsuhiko/gists{/gist_id}","starred_url":"https://api.github.com/users/mitsuhiko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitsuhiko/subscriptions","organizations_url":"https://api.github.com/users/mitsuhiko/orgs","repos_url":"https://api.github.com/users/mitsuhiko/repos","events_url":"https://api.github.com/users/mitsuhiko/events{/privacy}","received_events_url":"https://api.github.com/users/mitsuhiko/received_events","type":"User","site_admin":false},"created_at":"2015-07-19T21:38:21Z","updated_at":"2015-07-19T21:38:21Z","body":"Not a bug. The object might implement a reasonable `__lt__`."}}