mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fix skeleton for csv.register_dialect in Py2 so 'dialect' parameter type is resolved and PyTypeCheckerInspectionTest is able to match args with params
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
"""Skeleton for 'csv' stdlib module."""
|
||||
|
||||
def register_dialect(name, dialect=None, **fmtparams=None):
|
||||
import _csv
|
||||
|
||||
|
||||
def register_dialect(name, dialect=None, **fmtparams):
|
||||
"""Associate dialect with name.
|
||||
|
||||
:type name: string
|
||||
:type dialect: Dialect
|
||||
:type dialect: _csv.Dialect
|
||||
:rtype: None
|
||||
"""
|
||||
pass
|
||||
@@ -0,0 +1,5 @@
|
||||
def register_dialect(name, dialect):
|
||||
pass
|
||||
|
||||
class Dialect(object):
|
||||
pass
|
||||
@@ -0,0 +1,6 @@
|
||||
import csv
|
||||
|
||||
class A(object):
|
||||
pass
|
||||
|
||||
csv.register_dialect(<warning descr="Expected type 'Union[str, unicode]', got 'A' instead">A()</warning>, <warning descr="Expected type 'Dialect', got 'A' instead">A()</warning>, delimiter=':', quoting=csv.QUOTE_NONE)
|
||||
@@ -0,0 +1,3 @@
|
||||
from _csv import register_dialect
|
||||
|
||||
__all__ = ["register_dialect"]
|
||||
@@ -326,4 +326,9 @@ public class PyTypeCheckerInspectionTest extends PyTestCase {
|
||||
public void testFunctionReturnType() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
// PY-19522
|
||||
public void testCsvRegisterDialect() {
|
||||
doMultiFileTest();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user