Skip to content

Commit fe65fc5

Browse files
committed
rewrite: rename abstract.instances to abstract.containers.
PiperOrigin-RevId: 623328948
1 parent b9d1199 commit fe65fc5

File tree

4 files changed

+26
-26
lines changed

4 files changed

+26
-26
lines changed

pytype/rewrite/abstract/CMakeLists.txt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ py_library(
88
DEPS
99
.base
1010
.classes
11+
.containers
1112
.functions
12-
.instances
1313
.internal
1414
.utils
1515
)
@@ -63,43 +63,43 @@ py_test(
6363

6464
py_library(
6565
NAME
66-
functions
66+
containers
6767
SRCS
68-
functions.py
68+
containers.py
6969
DEPS
7070
.base
71-
pytype.blocks.blocks
72-
pytype.pytd.pytd
7371
)
7472

7573
py_test(
7674
NAME
77-
functions_test
75+
containers_test
7876
SRCS
79-
functions_test.py
77+
containers_test.py
8078
DEPS
81-
.classes
82-
.functions
79+
.base
80+
.containers
8381
pytype.rewrite.tests.test_utils
8482
)
8583

8684
py_library(
8785
NAME
88-
instances
86+
functions
8987
SRCS
90-
instances.py
88+
functions.py
9189
DEPS
9290
.base
91+
pytype.blocks.blocks
92+
pytype.pytd.pytd
9393
)
9494

9595
py_test(
9696
NAME
97-
instances_test
97+
functions_test
9898
SRCS
99-
instances_test.py
99+
functions_test.py
100100
DEPS
101-
.base
102-
.instances
101+
.classes
102+
.functions
103103
pytype.rewrite.tests.test_utils
104104
)
105105

pytype/rewrite/abstract/abstract.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
from pytype.rewrite.abstract import base as _base
44
from pytype.rewrite.abstract import classes as _classes
5+
from pytype.rewrite.abstract import containers as _containers
56
from pytype.rewrite.abstract import functions as _functions
6-
from pytype.rewrite.abstract import instances as _instances
77
from pytype.rewrite.abstract import internal as _internal
88
from pytype.rewrite.abstract import utils as _utils
99

@@ -31,10 +31,10 @@
3131
SimpleFunction = _functions.SimpleFunction
3232
SimpleReturn = _functions.SimpleReturn
3333

34-
Dict = _instances.Dict
35-
List = _instances.List
36-
Set = _instances.Set
37-
Tuple = _instances.Tuple
34+
Dict = _containers.Dict
35+
List = _containers.List
36+
Set = _containers.Set
37+
Tuple = _containers.Tuple
3838

3939
ConstKeyDict = _internal.ConstKeyDict
4040
Splat = _internal.Splat
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Abstract representations of class instances."""
1+
"""Abstract representations of builtin containers."""
22

33
import logging
44

pytype/rewrite/abstract/instances_test.py renamed to pytype/rewrite/abstract/containers_test.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from typing import Dict, List, Set, Tuple
22

33
from pytype.rewrite.abstract import base
4-
from pytype.rewrite.abstract import instances
4+
from pytype.rewrite.abstract import containers
55
from pytype.rewrite.tests import test_utils
66
from typing_extensions import assert_type
77

@@ -22,7 +22,7 @@ class ListTest(BaseTest):
2222

2323
def test_constant_type(self):
2424
a = self.const_var("a")
25-
c = instances.List(self.ctx, [a])
25+
c = containers.List(self.ctx, [a])
2626
assert_type(c.constant, List[_AbstractVariable])
2727

2828

@@ -31,15 +31,15 @@ class DictTest(BaseTest):
3131
def test_constant_type(self):
3232
a = self.const_var("a")
3333
b = self.const_var("b")
34-
c = instances.Dict(self.ctx, {a: b})
34+
c = containers.Dict(self.ctx, {a: b})
3535
assert_type(c.constant, Dict[_AbstractVariable, _AbstractVariable])
3636

3737

3838
class SetTest(BaseTest):
3939

4040
def test_constant_type(self):
4141
a = self.const_var("a")
42-
c = instances.Set(self.ctx, {a})
42+
c = containers.Set(self.ctx, {a})
4343
assert_type(c.constant, Set[_AbstractVariable])
4444

4545

@@ -48,7 +48,7 @@ class TupleTest(BaseTest):
4848
def test_constant_type(self):
4949
a = self.const_var("a")
5050
b = self.const_var("b")
51-
c = instances.Tuple(self.ctx, (a, b))
51+
c = containers.Tuple(self.ctx, (a, b))
5252
assert_type(c.constant, Tuple[_AbstractVariable, ...])
5353

5454

0 commit comments

Comments
 (0)