Skip to content
Permalink
Browse files

Merge pull request #739 from kostya/allocate

allocate does not accept any arguments
  • Loading branch information
alex committed May 27, 2013
2 parents 9c3d418 + 5c70568 commit 51e421d294e4ada427d584a4c0b7aa427aa387d4

This file was deleted.

@@ -55,7 +55,7 @@ def listview(self, space):
return self.items_w

@classdef.singleton_method("allocate")
def singleton_method_allocate(self, space, args_w):
def singleton_method_allocate(self, space):
return W_ArrayObject(space, [], self)

@classdef.method("initialize_copy", other_w="array")
@@ -118,17 +118,17 @@ def method_undefined(self, space, w_name):
W_ModuleObject.method_undefined(self, space, w_name)

@classdef.singleton_method("allocate")
def singleton_method_allocate(self, space, args_w):
def singleton_method_allocate(self, space):
return space.newclass(None, None)

@classdef.method("new")
def method_new(self, space, args_w, block):
w_obj = space.send(self, "allocate", args_w, block)
w_obj = space.send(self, "allocate")
space.send(w_obj, "initialize", args_w, block)
return w_obj

@classdef.method("allocate")
def method_allocate(self, space, args_w):
def method_allocate(self, space):
return W_Object(space, self)

@classdef.method("initialize")
@@ -36,7 +36,7 @@ def method_initialize(self, space, path):
self.open = True

@classdef.singleton_method("allocate")
def method_allocate(self, space, args_w):
def method_allocate(self, space):
return W_DirObject(space)

@classdef.singleton_method("pwd")
@@ -4,7 +4,7 @@

def new_exception_allocate(classdef):
@classdef.singleton_method("allocate")
def method_allocate(self, space, args_w):
def method_allocate(self, space):
return classdef.cls(space, self)


@@ -51,7 +51,7 @@ def setup_class(cls, space, w_cls):
space.set_const(w_cls, "Stat", space.getclassfor(W_FileStatObject))

@classdef.singleton_method("allocate")
def method_allocate(self, space, args_w):
def method_allocate(self, space):
return W_FileObject(space)

@classdef.singleton_method("size?", name="path")
@@ -328,7 +328,7 @@ def get_stat(self, space):
return self._stat

@classdef.singleton_method("allocate")
def singleton_method_allocate(self, space, w_args):
def singleton_method_allocate(self, space):
return W_FileStatObject(space)

@classdef.method("initialize", filename="path")
@@ -16,7 +16,7 @@ def __init__(self, space, klass=None):
self.default_proc = None

@classdef.singleton_method("allocate")
def method_allocate(self, space, args_w):
def method_allocate(self, space):
return W_HashObject(space, self)

@classdef.singleton_method("try_convert")
@@ -161,18 +161,18 @@ def method_includep(self, space, w_key):
class W_HashIterator(W_Object):
classdef = ClassDef("HashIterator", W_Object.classdef)

def __init__(self, space, d):
def __init__(self, space):
W_Object.__init__(self, space)
self.iterator = d.iteritems()

@classdef.singleton_method("allocate")
def method_allocate(self, space, w_obj):
assert isinstance(w_obj, W_HashObject)
return W_HashIterator(space, w_obj.contents)
def method_allocate(self, space):
return W_HashIterator(space)

@classdef.method("initialize")
def method_initialize(self, w_obj):
pass
assert isinstance(w_obj, W_HashObject)
self.iterator = w_obj.contents.iteritems()
return self

@classdef.method("next")
def method_next(self, space):
@@ -38,7 +38,7 @@ def retry_binop_coercing(space, w_recv, w_arg, binop, raise_error=True):
return None

@classdef.singleton_method("allocate")
def method_allocate(self, space, args_w):
def method_allocate(self, space):
return W_NumericObject(space, self)

@classdef.method("<=>")
@@ -23,9 +23,9 @@ def setup_class(cls, space, w_cls):
default = space.send(w_cls, "new")
space.set_const(w_cls, "DEFAULT", default)

@classdef.singleton_method("allocate", seed="int")
def method_allocate(self, space, seed=0):
return W_RandomObject(space, seed, self)
@classdef.singleton_method("allocate")
def method_allocate(self, space):
return W_RandomObject(space, 0, self)

@classdef.method("initialize")
def method_initialize(self, space, w_seed=None):
@@ -14,7 +14,7 @@ def __init__(self, space, w_start, w_end, exclusive):
self.exclusive = exclusive

@classdef.singleton_method("allocate")
def method_allocate(self, space, args_w):
def method_allocate(self, space):
return W_RangeObject(space, None, None, False)

@classdef.method("initialize", excl="bool")
@@ -154,12 +154,12 @@ def get_match_result(self, space, ctx, found):
return w_match

@classdef.singleton_method("allocate")
def method_allocate(self, space, args_w):
def method_allocate(self, space):
return W_RegexpObject(space, None, 0)

@classdef.singleton_method("compile")
def method_compile(self, space, args_w):
w_obj = space.send(self, "allocate", args_w)
w_obj = space.send(self, "allocate")
return space.send(w_obj, "initialize", args_w)

@classdef.method("initialize", flags="int")
@@ -423,7 +423,7 @@ def tr_trans(self, space, source, replacement, squeeze):
return new_string if change_made else None

@classdef.singleton_method("allocate")
def singleton_method_allocate(self, space, w_s=None):
def singleton_method_allocate(self, space):
strategy = space.fromcache(ConstantStringStrategy)
storage = strategy.erase("")
return W_StringObject(space, storage, strategy, self)

0 comments on commit 51e421d

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