Permalink
Browse files

Made it so that py_from_module on a module really does return self, w…

…hich was supposed to be the case in my previous commit.
  • Loading branch information...
1 parent bf34df6 commit 521c25e9010423ba18f402df7c656484624df6e6 @stormbrew stormbrew committed Dec 24, 2010
Showing with 4 additions and 7 deletions.
  1. +1 −4 lib/typhon/environment/module.rb
  2. +3 −3 lib/typhon/environment/python_object.rb
@@ -17,10 +17,7 @@ module Environment
s.py_set(:__name__, name)
s.py_set(:__doc__, doc)
s.py_set(:__file__, filename)
- end
-
- def py_module_from
- return self
+ s.py_from_module = s
end
end
@@ -28,7 +28,7 @@ def py_data_descriptor; false; end
attr_reader :py_type
attr_reader :py_attributes
- attr_reader :py_from_module
+ attr_accessor :py_from_module
# this is a hash that applies *only* to this
# object, with no inheritance rules applied.
@@ -146,7 +146,7 @@ def py_del(name)
def py_send(method, *args)
py_get(method).invoke(*args)
end
-
+
def py_instance_string()
"<#{@py_type && @py_type.module && @py_type.module.py_get(:__name__) || '?'}.#{@py_type && @py_type.name || '?'} object at 0x#{object_id.to_s(16)}>"
end
@@ -192,7 +192,7 @@ def inspect()
alias :to_s :inspect
alias :to_str :inspect
-
+
def to_py
return self
end

0 comments on commit 521c25e

Please sign in to comment.