I know that there’s a function called id so I wouldn’t create a function or a variable called id, but what about an attribute on an object?
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.
That’s ok, and is pretty common. For example, objects mapped to a database record will often have an “id” attribute mapped to the database “id” column value.
Attributes are always “namespaced” so you have to refer to them via
self.idorobj.idso there’s no conflict with the built-in function.