8000 More little improvements to newint and newstr · thecodingchicken/python-future@a3968f1 · GitHub
[go: up one dir, main page]

Skip to content

Commit a3968f1

Browse files
committed
More little improvements to newint and newstr
1 parent b7bad22 commit a3968f1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

future/builtins/backports/newint.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ def __new__(cls, *args, **kwargs):
3838
"""
3939
if len(args) == 0:
4040
return super(newint, cls).__new__(cls, **kwargs)
41-
elif isinstance(args[0], Integral):
42-
return args[0]
4341
return super(newint, cls).__new__(cls, *args, **kwargs)
4442

4543
def __repr__(self):

future/builtins/backports/newstr.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ def __radd__(self, left):
127127
except:
128128
raise NotImplemented
129129

130+
def __mul__(self, other):
131+
return newstr(super(newstr, self).__mul__(other))
132+
133+
def __rmul__(self, other):
134+
return newstr(super(newstr, self).__rmul__(other))
135+
130136
def join(self, iterable):
131137
errmsg = 'sequence item {}: expected unicode string, found bytes'
132138
for i, item in enumerate(iterable):

0 commit comments

Comments
 (0)
0