| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -172,7 +172,7 @@ def __repr__(self): | |||
| 172 | 172 | def __cmp__(self, other, *rest): | |
| 173 | 173 | #rprt('%r.__cmp__%r\n' % (self, (other,) + rest)) | |
| 174 | 174 | if type(other) != type(self): | |
| 175 | - other = apply(bitvec, (other, ) + rest) | ||
| 175 | + other = bitvec(other, *rest) | ||
| 176 | 176 | #expensive solution... recursive binary, with slicing | |
| 177 | 177 | length = self._len | |
| 178 | 178 | if length == 0 or other._len == 0: | |
@@ -237,7 +237,7 @@ def __setslice__(self, i, j, sequence, *rest): | |||
| 237 | 237 | #rprt('%s.__setslice__%r\n' % (self, (i, j, sequence) + rest)) | |
| 238 | 238 | i, j = _check_slice(self._len, i, j) | |
| 239 | 239 | if type(sequence) != type(self): | |
| 240 | - sequence = apply(bitvec, (sequence, ) + rest) | ||
| 240 | + sequence = bitvec(sequence, *rest) | ||
| 241 | 241 | #sequence is now of our own type | |
| 242 | 242 | ls_part = self[:i] | |
| 243 | 243 | ms_part = self[j:] | |
@@ -283,7 +283,7 @@ def __mul__(self, multiplier): | |||
| 283 | 283 | def __and__(self, otherseq, *rest): | |
| 284 | 284 | #rprt('%r.__and__%r\n' % (self, (otherseq,) + rest)) | |
| 285 | 285 | if type(otherseq) != type(self): | |
| 286 | - otherseq = apply(bitvec, (otherseq, ) + rest) | ||
| 286 | + otherseq = bitvec(otherseq, *rest) | ||
| 287 | 287 | #sequence is now of our own type | |
| 288 | 288 | return BitVec(self._data & otherseq._data, \ | |
| 289 | 289 | min(self._len, otherseq._len)) | |
@@ -292,7 +292,7 @@ def __and__(self, otherseq, *rest): | |||
| 292 | 292 | def __xor__(self, otherseq, *rest): | |
| 293 | 293 | #rprt('%r.__xor__%r\n' % (self, (otherseq,) + rest)) | |
| 294 | 294 | if type(otherseq) != type(self): | |
| 295 | - otherseq = apply(bitvec, (otherseq, ) + rest) | ||
| 295 | + otherseq = bitvec(otherseq, *rest) | ||
| 296 | 296 | #sequence is now of our own type | |
| 297 | 297 | return BitVec(self._data ^ otherseq._data, \ | |
| 298 | 298 | max(self._len, otherseq._len)) | |
@@ -301,7 +301,7 @@ def __xor__(self, otherseq, *rest): | |||
| 301 | 301 | def __or__(self, otherseq, *rest): | |
| 302 | 302 | #rprt('%r.__or__%r\n' % (self, (otherseq,) + rest)) | |
| 303 | 303 | if type(otherseq) != type(self): | |
| 304 | - otherseq = apply(bitvec, (otherseq, ) + rest) | ||
| 304 | + otherseq = bitvec(otherseq, *rest) | ||
| 305 | 305 | #sequence is now of our own type | |
| 306 | 306 | return BitVec(self._data | otherseq._data, \ | |
| 307 | 307 | max(self._len, otherseq._len)) | |
@@ -316,7 +316,7 @@ def __coerce__(self, otherseq, *rest): | |||
| 316 | 316 | #needed for *some* of the arithmetic operations | |
| 317 | 317 | #rprt('%r.__coerce__%r\n' % (self, (otherseq,) + rest)) | |
| 318 | 318 | if type(otherseq) != type(self): | |
| 319 | - otherseq = apply(bitvec, (otherseq, ) + rest) | ||
| 319 | + otherseq = bitvec(otherseq, *rest) | ||
| 320 | 320 | return self, otherseq | |
| 321 | 321 | ||
| 322 | 322 | def __int__(self): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -82,10 +82,10 @@ def __init__(self, func, inst): | |||
| 82 | 82 | ||
| 83 | 83 | def __call__(self, *args, **kw): | |
| 84 | 84 | if self.pre: | |
| 85 | - apply(self.pre, args, kw) | ||
| 86 | - Result = apply(self.func, (self.inst,) + args, kw) | ||
| 85 | + self.pre(*args, **kw) | ||
| 86 | + Result = self.func(self.inst, *args, **kw) | ||
| 87 | 87 | if self.post: | |
| 88 | - apply(self.post, (Result,) + args, kw) | ||
| 88 | + self.post(Result, *args, **kw) | ||
| 89 | 89 | return Result | |
| 90 | 90 | ||
| 91 | 91 | class EiffelHelper(MetaHelper): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,7 +14,7 @@ def __init__(self, func, inst): | |||
| 14 | 14 | self.__name__ = self.func.__name__ | |
| 15 | 15 | ||
| 16 | 16 | def __call__(self, *args, **kw): | |
| 17 | - return apply(self.func, (self.inst,) + args, kw) | ||
| 17 | + return self.func(self.inst, *args, **kw) | ||
| 18 | 18 | ||
| 19 | 19 | class MetaHelper: | |
| 20 | 20 | ||
@@ -86,7 +86,7 @@ def __call__(self, *args, **kw): | |||
| 86 | 86 | init = inst.__getattr__('__init__') | |
| 87 | 87 | except AttributeError: | |
| 88 | 88 | init = lambda: None | |
| 89 | - apply(init, args, kw) | ||
| 89 | + init(*args, **kw) | ||
| 90 | 90 | return inst | |
| 91 | 91 | ||
| 92 | 92 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,7 +28,7 @@ def __init__(self, function, instance): | |||
| 28 | 28 | self.instance = instance | |
| 29 | 29 | def __call__(self, *args): | |
| 30 | 30 | print "calling", self.function, "for", self.instance, "with", args | |
| 31 | - return apply(self.function, (self.instance,) + args) | ||
| 31 | + return self.function(self.instance, *args) | ||
| 32 | 32 | ||
| 33 | 33 | Trace = Tracing('Trace', (), {}) | |
| 34 | 34 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -148,10 +148,10 @@ def f1(lock, f2=f2, done=done): | |||
| 148 | 148 | class LockingMethodWrapper(MetaMethodWrapper): | |
| 149 | 149 | def __call__(self, *args, **kw): | |
| 150 | 150 | if self.__name__[:1] == '_' and self.__name__[1:] != '_': | |
| 151 | - return apply(self.func, (self.inst,) + args, kw) | ||
| 151 | + return self.func(self.inst, *args, **kw) | ||
| 152 | 152 | self.inst.__lock__.acquire() | |
| 153 | 153 | try: | |
| 154 | - return apply(self.func, (self.inst,) + args, kw) | ||
| 154 | + return self.func(self.inst, *args, **kw) | ||
| 155 | 155 | finally: | |
| 156 | 156 | self.inst.__lock__.release() | |
| 157 | 157 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -50,7 +50,7 @@ def __call__(self, *args, **kw): | |||
| 50 | 50 | init = inst.__getattr__('__init__') | |
| 51 | 51 | except AttributeError: | |
| 52 | 52 | init = lambda: None | |
| 53 | - apply(init, args, kw) | ||
| 53 | + init(*args, **kw) | ||
| 54 | 54 | return inst | |
| 55 | 55 | ||
| 56 | 56 | __trace_output__ = None | |
@@ -85,15 +85,15 @@ def __init__(self, name, func, inst): | |||
| 85 | 85 | self.func = func | |
| 86 | 86 | self.inst = inst | |
| 87 | 87 | def __call__(self, *args, **kw): | |
| 88 | - return apply(self.func, (self.inst,) + args, kw) | ||
| 88 | + return self.func(self.inst, *args, **kw) | ||
| 89 | 89 | ||
| 90 | 90 | class TracingWrapper(NotTracingWrapper): | |
| 91 | 91 | def __call__(self, *args, **kw): | |
| 92 | 92 | self.inst.__trace_call__(self.inst.__trace_output__, | |
| 93 | 93 | "calling %s, inst=%s, args=%s, kw=%s", | |
| 94 | 94 | self.__name__, self.inst, args, kw) | |
| 95 | 95 | try: | |
| 96 | - rv = apply(self.func, (self.inst,) + args, kw) | ||
| 96 | + rv = self.func(self.inst, *args, **kw) | ||
| 97 | 97 | except: | |
| 98 | 98 | t, v, tb = sys.exc_info() | |
| 99 | 99 | self.inst.__trace_call__(self.inst.__trace_output__, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -186,7 +186,7 @@ def test(): | |||
| 186 | 186 | if hasattr(proxy, what): | |
| 187 | 187 | attr = getattr(proxy, what) | |
| 188 | 188 | if callable(attr): | |
| 189 | - print apply(attr, tuple(sys.argv[2:])) | ||
| 189 | + print attr(*sys.argv[2:]) | ||
| 190 | 190 | else: | |
| 191 | 191 | print repr(attr) | |
| 192 | 192 | else: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -132,12 +132,11 @@ def _flush(self): | |||
| 132 | 132 | class SecureClient(Client, Security): | |
| 133 | 133 | ||
| 134 | 134 | def __init__(self, *args): | |
| 135 | - import string | ||
| 136 | - apply(self._pre_init, args) | ||
| 135 | + self._pre_init(*args) | ||
| 137 | 136 | Security.__init__(self) | |
| 138 | 137 | self._wf.flush() | |
| 139 | 138 | line = self._rf.readline() | |
| 140 | - challenge = string.atoi(string.strip(line)) | ||
| 139 | + challenge = int(line.strip()) | ||
| 141 | 140 | response = self._encode_challenge(challenge) | |
| 142 | 141 | line = repr(long(response)) | |
| 143 | 142 | if line[-1] in 'Ll': line = line[:-1] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -81,7 +81,7 @@ def _dorequest(self, rf, wf): | |||
| 81 | 81 | raise NameError, "illegal method name %s" % repr(methodname) | |
| 82 | 82 | else: | |
| 83 | 83 | method = getattr(self, methodname) | |
| 84 | - reply = (None, apply(method, args), id) | ||
| 84 | + reply = (None, method(*args), id) | ||
| 85 | 85 | except: | |
| 86 | 86 | reply = (sys.exc_info()[:2], id) | |
| 87 | 87 | if id < 0 and reply[:2] == (None, None): | |
@@ -117,7 +117,7 @@ def _listmethods(self, cl=None): | |||
| 117 | 117 | class SecureServer(Server, Security): | |
| 118 | 118 | ||
| 119 | 119 | def __init__(self, *args): | |
| 120 | - apply(Server.__init__, (self,) + args) | ||
| 120 | + Server.__init__(self, *args) | ||
| 121 | 121 | Security.__init__(self) | |
| 122 | 122 | ||
| 123 | 123 | def _verify(self, conn, address): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -115,7 +115,7 @@ def _start(self, me, *args): | |||
| 115 | 115 | if not self.killed: | |
| 116 | 116 | try: | |
| 117 | 117 | try: | |
| 118 | - apply(me.f, args) | ||
| 118 | + me.f(*args) | ||
| 119 | 119 | except Killed: | |
| 120 | 120 | pass | |
| 121 | 121 | finally: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments