General rule: do not use names that are accepted (for example, type , file , int , etc.), regardless of whether they are in the list of reserved keywords or not (since python allows this, it really is not "reserved" ) This is mainly important to avoid getting into trouble when you really need to use a real object (without noticing that you are redirecting it locally).
If you really want to use one of these names, just add _ to the end (e.g. type_ ).
In your case, since you specify type as an attribute of a class, it should be considered safe, since it can only be accessed through its class ( self.type or SomeProfile.type ).
sirfz source share