Skip to content

Use python2 new-style classes in context.py #2

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

Closed
wants to merge 1 commit into from

Conversation

mrodden
Copy link

@mrodden mrodden commented Jan 31, 2017

Use the python2 new-style class syntax so we can
avoid issues with calls to super() and other inheritance issues.
This has no effect on python3, as it both class declarations
are equivalent.

For verification run the following snippet on py2 and py3:

  from __future__ import print_function

  class MyThing(object):
      pass

  class MyThing2:
      pass

  print(issubclass(MyThing, object))
  # True on py2 and py3

  print(issubclass(MyThing2, object))
  # False on py2, True on py3

Use the python2 new-style class syntax so we can
avoid issues with calls to super() and other inheritance issues.
This has no effect on python3, as it both class declarations
are equivalent.

For verification run the following snippet on py2 and py3:

  from __future__ import print_function

  class MyThing(object):
      pass

  class MyThing2:
      pass

  print(issubclass(MyThing, object))
  # True on py2 and py3

  print(issubclass(MyThing2, object))
  # False on py2, True on py3
@mrodden mrodden closed this Jan 31, 2017
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.

1 participant