Can I use clean Python 3 super() syntax in Python 2.5.6?
Maybe with some kind of __future__ import?
Can I use clean Python 3 super() syntax in Python 2.5.6? Maybe with some
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You cannot use a bare
super()call that contains no type/class. Nor can you implement a replacement for it that will work. Python 3.x contains special support to enable baresuper()calls (it places a__class__cell variable in all functions defined within a class – see PEP 3135Update
As of Python 2.6+, bare
super()calls can be used via thefuturePython package. See posita’s answer for an explanation.