Page 1 of 1

Understanding some class attributes?

Posted: Fri Sep 27, 2013 11:13 pm
by arawra
In entites.py (packages/source-python/entities/) there is this code in its __setattr__ method:

Code: Select all

            if self.__class__ != BaseEntity:

                # Get the attribute and set its value               
                getattr(self.__class__, attr).fset(self, value)

                # No need to go further
                return


How come it doesn't use "object.__setattr__(self, attr, value)" ? Its causing me issues when trying to subclass PlayerEntity and when setting the index in my class.
'int' has no attribute 'fset' (or something similar)

Posted: Sat Sep 28, 2013 5:12 am
by Omega_K2
I guess PlayerEntity hasn't really been updated.

Posted: Sun Sep 29, 2013 4:51 am
by arawra
This was working before I updated CS:GO and built Source-Python from source code. Do you have any solutions? I am not that familiar with classing and changing the get/set attributes.