Skip to content
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

Django 1.8+ compatibility #36

Merged
merged 2 commits into from
Apr 6, 2015
Merged

Django 1.8+ compatibility #36

merged 2 commits into from
Apr 6, 2015

Conversation

maryokhin
Copy link
Contributor

As per the deprecation note.

@jschneier
Copy link
Owner

Thanks for this it looks great! My only concern is whether the super calls with no arguments will work on Python2.

@maryokhin
Copy link
Contributor Author

@mbarrien
Copy link
Contributor

mbarrien commented Apr 5, 2015

Wrong, argumentless super() was introduced in Python 3, and never back ported. From a Python 2.7 REPL session:

>>> class Foo(object):
...     def func(self):
...         print "Foo"
...
>>> class Bar(Foo):
...     def func(self):
...         super().func()
...
>>> Bar().func()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 3, in func
TypeError: super() takes at least 1 argument (0 given)
>>>

See first entry under Builtins at https://docs.python.org/3.0/whatsnew/3.0.html (the note about PEP 3135).

@maryokhin
Copy link
Contributor Author

Ok, true. I don't use Python 2, didn't expect it to still be such a mess. I'll fix it.

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