{"action":"opened","issue":{"url":"https://api.github.com/repos/pypa/packaging/issues/48","labels_url":"https://api.github.com/repos/pypa/packaging/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/pypa/packaging/issues/48/comments","events_url":"https://api.github.com/repos/pypa/packaging/issues/48/events","html_url":"https://github.com/pypa/packaging/issues/48","id":120059745,"number":48,"title":"Incompliant SpecifierSet behavior with prerelease versions","user":{"login":"arcivanov","id":5355666,"avatar_url":"https://avatars.githubusercontent.com/u/5355666?v=3","gravatar_id":"","url":"https://api.github.com/users/arcivanov","html_url":"https://github.com/arcivanov","followers_url":"https://api.github.com/users/arcivanov/followers","following_url":"https://api.github.com/users/arcivanov/following{/other_user}","gists_url":"https://api.github.com/users/arcivanov/gists{/gist_id}","starred_url":"https://api.github.com/users/arcivanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arcivanov/subscriptions","organizations_url":"https://api.github.com/users/arcivanov/orgs","repos_url":"https://api.github.com/users/arcivanov/repos","events_url":"https://api.github.com/users/arcivanov/events{/privacy}","received_events_url":"https://api.github.com/users/arcivanov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-02T23:30:32Z","updated_at":"2015-12-02T23:30:32Z","closed_at":null,"body":"Consider the following [snippet](https://github.com/pypa/packaging/blob/master/packaging/specifiers.py#L717):\r\n```\r\n        # We can determine if we're going to allow pre-releases by looking to\r\n        # see if any of the underlying items supports them. If none of them do\r\n        # and this item is a pre-release then we do not allow it and we can\r\n        # short circuit that here.\r\n        # Note: This means that 1.0.dev1 would not be contained in something\r\n        #       like >=1.0.devabc however it would be in >=1.0.debabc,>0.0.dev0\r\n        if not prereleases and item.is_prerelease:\r\n            return False\r\n```\r\nThe actual code does not comply with the stated purpose in the comment above.\r\n\r\n`SpecifierSet(\">=1.0.devabc,>0.0.dev0\", False).contains(Version(\"1.0.dev1\")) == False`\r\n\r\nWhat should be happening is:\r\n\r\n```\r\nSpecifierSet(\">=1.0\", False).contains(Version(\"1.0.dev1\")) == False\r\nSpecifierSet(\">=1.0\", True).contains(Version(\"1.0.dev1\")) == True\r\nSpecifierSet(\">=1.0,>0.0.dev0\", False).contains(Version(\"1.0.dev1\")) == True\r\nSpecifierSet(\">=1.0,>0.0.dev0\", True).contains(Version(\"1.0.dev1\")) == True\r\n```"}}