mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
PY-19028 Fixed: Byte slices return incorrect type inference
Update skeletons to have correct return type for bytes.__getitem__
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
a = b'1234'[:3]
|
||||
print(a.decode('utf-8'))
|
||||
+6
-1
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user