I am aware that the namedtuple class exists from 2.6 onwards.
Is there a way of implementing similar functionality in Python 2.5 so normal tuples can be made to achieve this?
Student = namedtuple('Student', 'name serial')
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.
There is a recipe to implement named tuples in Python 2.4 and later. You can compare this to the actual implementation of named tuples in, say, Python 2.7 here.