Commit 2cf04700 authored by Marius Wachtler's avatar Marius Wachtler

Add str + unicode concat support

parent effb956b
......@@ -290,9 +290,15 @@ extern "C" PyObject* PyString_FromFormat(const char* format, ...) noexcept {
return ret;
}
extern "C" BoxedString* strAdd(BoxedString* lhs, Box* _rhs) {
extern "C" Box* strAdd(BoxedString* lhs, Box* _rhs) {
assert(lhs->cls == str_cls);
if (_rhs->cls == unicode_cls) {
Box* rtn = PyUnicode_Concat(lhs, _rhs);
checkAndThrowCAPIException();
return rtn;
}
if (_rhs->cls != str_cls) {
raiseExcHelper(TypeError, "cannot concatenate 'str' and '%s' objects", getTypeName(_rhs));
}
......
......@@ -27,6 +27,8 @@ print u'a' in c.__dict__
print u'' == ''
print '' == u''
print hash(u'') == hash('')
print "Hello " + u" World"
print u"Hello " + " World"
try:
hasattr(object(), u"\u0180")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment