Skip to content
Permalink
Browse files

Merge pull request #686 from krekoten/class_initialize

Class#initialize on already initialized class
  • Loading branch information
alex committed May 7, 2013
2 parents 04ab62f + 0c913fb commit bcf99ffd4e9cf2202e8468a99f115f0a5812cb1e
Showing with 2 additions and 2 deletions.
  1. +0 −2 spec/tags/core/class/initialize_tags.txt
  2. +2 −0 topaz/objects/classobject.py
@@ -1,3 +1 @@
fails:Class#initialize is private
fails:Class#initialize raises a TypeError when called on already initialized classes
fails:Class#initialize raises a TypeError when called on BasicObject
@@ -110,6 +110,8 @@ def method_allocate(self, space, args_w):

@classdef.method("initialize")
def method_initialize(self, space, w_superclass=None, block=None):
if self.superclass is not None or self is space.w_basicobject:
raise space.error(space.w_TypeError, "already initialized class")
if w_superclass is not None:
if not isinstance(w_superclass, W_ClassObject):
raise space.error(space.w_TypeError,

0 comments on commit bcf99ff

Please sign in to comment.
You can’t perform that action at this time.