Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix implementation of __setattr__

I was getting the exception

  Traceback (most recent call last):
    ...
    File ".\pipe_views.py", line 20, in __init__
    File ".\pipe_views.py", line 17, in __setattr__
  TypeError: super(type, obj): obj must be an instance or subtype of type

This is possibly due to __setattr__() being called at __init__() time,
mentioned in

  http://code.activestate.com/recipes/389916-example-setattr-getattr-overloading/
  • Loading branch information...
commit a18f48215a6017382230da321835d35f2c80fbf6 1 parent 3fb1193
@rctay authored
Showing with 1 addition and 5 deletions.
  1. +1 −5 pipe_views.py
View
6 pipe_views.py
@@ -7,14 +7,10 @@ class PipeViews(object):
def __setattr__(self, name, value):
if name is "enabled_setting":
value = value is None or value
- object.__setattr__(self, name, value)
- return
elif name is "scroll_setting":
value = value if value in set(["bottom", "top", "last"]) else "bottom"
- object.__setattr__(self, name, value)
- return
- return super(PipeViews, self).__setattr__(name, value)
+ object.__setattr__(self, name, value)
def __init__(self):
self.source_last_pos = 0
Please sign in to comment.
Something went wrong with that request. Please try again.