PY-19028 Fixed: Byte slices return incorrect type inference

Update skeletons to have correct return type for bytes.__getitem__
This commit is contained in:
Semyon Proshev
2016-04-13 21:55:43 +03:00
parent c6f0a296e2
commit 1d7c5fbe69
3 changed files with 9 additions and 2 deletions
+1 -1
View File
@@ -980,7 +980,7 @@ class bytes(object):
"""y-th item of x, origin 0.
:type y: numbers.Integral
:rtype: int
:rtype: int | bytes
"""
return 0
@@ -0,0 +1,2 @@
a = b'1234'[:3]
print(a.decode('utf-8'))
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -137,4 +137,9 @@ public class Py3UnresolvedReferencesInspectionTest extends PyTestCase {
public void testNoMostDerivedMetaClass() {
doTest();
}
// PY-19028
public void testDecodeBytesAfterSlicing() {
doTest();
}
}