]> git.madduck.net Git - etc/vim.git/blob - tests/data/collections.py

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Fix regression: unexpected parentheses around non-mathematical powers
[etc/vim.git] / tests / data / collections.py
1 import core, time, a
2
3 from . import A, B, C
4
5 # unwraps
6 from foo import (
7     bar,
8 )
9
10 # stays wrapped
11 from foo import (
12     baz,
13     qux,
14 )
15
16 # as doesn't get confusing when unwrapped
17 from foo import (
18     xyzzy as magic,
19 )
20
21 a = {1,2,3,}
22 b = {
23 1,2,
24      3}
25 c = {
26     1,
27     2,
28     3,
29 }
30 x = 1,
31 y = narf(),
32 nested = {(1,2,3),(4,5,6),}
33 nested_no_trailing_comma = {(1,2,3),(4,5,6)}
34 nested_long_lines = ["aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "cccccccccccccccccccccccccccccccccccccccc", (1, 2, 3), "dddddddddddddddddddddddddddddddddddddddd"]
35 {"oneple": (1,),}
36 {"oneple": (1,)}
37 ['ls', 'lsoneple/%s' % (foo,)]
38 x = {"oneple": (1,)}
39 y = {"oneple": (1,),}
40 assert False, ("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa wraps %s" % bar)
41
42 # looping over a 1-tuple should also not get wrapped
43 for x in (1,):
44     pass
45 for (x,) in (1,), (2,), (3,):
46     pass
47
48 [1, 2, 3,]
49
50 division_result_tuple = (6/2,)
51 print("foo %r", (foo.bar,))
52
53 if True:
54     IGNORED_TYPES_FOR_ATTRIBUTE_CHECKING = (
55         Config.IGNORED_TYPES_FOR_ATTRIBUTE_CHECKING
56         | {pylons.controllers.WSGIController}
57     )
58
59 if True:
60     ec2client.get_waiter('instance_stopped').wait(
61         InstanceIds=[instance.id],
62         WaiterConfig={
63             'Delay': 5,
64         })
65     ec2client.get_waiter("instance_stopped").wait(
66         InstanceIds=[instance.id],
67         WaiterConfig={"Delay": 5,},
68     )
69     ec2client.get_waiter("instance_stopped").wait(
70         InstanceIds=[instance.id], WaiterConfig={"Delay": 5,},
71     )
72
73 # output
74
75
76 import core, time, a
77
78 from . import A, B, C
79
80 # unwraps
81 from foo import bar
82
83 # stays wrapped
84 from foo import (
85     baz,
86     qux,
87 )
88
89 # as doesn't get confusing when unwrapped
90 from foo import xyzzy as magic
91
92 a = {
93     1,
94     2,
95     3,
96 }
97 b = {1, 2, 3}
98 c = {
99     1,
100     2,
101     3,
102 }
103 x = (1,)
104 y = (narf(),)
105 nested = {
106     (1, 2, 3),
107     (4, 5, 6),
108 }
109 nested_no_trailing_comma = {(1, 2, 3), (4, 5, 6)}
110 nested_long_lines = [
111     "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
112     "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
113     "cccccccccccccccccccccccccccccccccccccccc",
114     (1, 2, 3),
115     "dddddddddddddddddddddddddddddddddddddddd",
116 ]
117 {
118     "oneple": (1,),
119 }
120 {"oneple": (1,)}
121 ["ls", "lsoneple/%s" % (foo,)]
122 x = {"oneple": (1,)}
123 y = {
124     "oneple": (1,),
125 }
126 assert False, (
127     "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa wraps %s"
128     % bar
129 )
130
131 # looping over a 1-tuple should also not get wrapped
132 for x in (1,):
133     pass
134 for (x,) in (1,), (2,), (3,):
135     pass
136
137 [
138     1,
139     2,
140     3,
141 ]
142
143 division_result_tuple = (6 / 2,)
144 print("foo %r", (foo.bar,))
145
146 if True:
147     IGNORED_TYPES_FOR_ATTRIBUTE_CHECKING = Config.IGNORED_TYPES_FOR_ATTRIBUTE_CHECKING | {
148         pylons.controllers.WSGIController
149     }
150
151 if True:
152     ec2client.get_waiter("instance_stopped").wait(
153         InstanceIds=[instance.id], WaiterConfig={"Delay": 5,}
154     )
155     ec2client.get_waiter("instance_stopped").wait(
156         InstanceIds=[instance.id], WaiterConfig={"Delay": 5,},
157     )
158     ec2client.get_waiter("instance_stopped").wait(
159         InstanceIds=[instance.id], WaiterConfig={"Delay": 5,},
160     )