Skip to content

Add missing classes to distutils.version #450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 5, 2016

Conversation

euresti
Copy link
Contributor

@euresti euresti commented Aug 5, 2016

This was removed in #418 for some reason. I regenerated stubs and hand merged the differences.

class Version:
def __init__(self, vstring=None): ...

if sys.version_info >= (3,):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks odd. What's the backstory?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which part looks odd, the sys.version_info or the fact that there was an empty file there?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks odd that you have to declare these elementary operations (__eq__ etc.), but only for Python 3.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. Well the class in python3 actually has those methods but doesn't in
Python 2. In python2 they are implemented as cmp in the subclasses.

On Aug 5, 2016 2:31 PM, "Matthias Kramm" [email protected] wrote:

In stdlib/2and3/distutils/version.pyi
#450 (comment):

@@ -0,0 +1,35 @@
+# Stubs for distutils.version (Python 2 and 3.5)
+#
+# NOTE: This dynamically typed stub was automatically generated by stubgen.
+
+import sys
+from typing import Any
+
+class Version:

  • def init(self, vstring=None): ...
  • if sys.version_info >= (3,):

It looks odd that you have to declare these elementary operations (eq
etc.), but only for Python 3.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/python/typeshed/pull/450/files/26a3950c3e3718d1ff83854ce34bbd0b80212d7e#r73762483,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABCCAps7FcoRoI9KOEZV8mrkt5Pp9sLyks5qc6uVgaJpZM4JeEiI
.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It probably doesn't matter that the Python 3 version has them, since the return values are identical to the ones on object. (And that the implementation differs is irrelevant for typing)

@gvanrossum gvanrossum merged commit 5de7bfe into python:master Aug 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants