Skip to content

Commit 53abed9

Browse files
vdusekclaude
andcommitted
style: Collapse single-line __init__ and super().__init__() where they fit
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f171b91 commit 53abed9

27 files changed

+104
-488
lines changed

src/apify_client/_resource_clients/actor.py

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,8 @@ class ActorClient(ResourceClient):
5656
via an appropriate method on the `ApifyClient` class.
5757
"""
5858

59-
def __init__(
60-
self,
61-
*,
62-
resource_id: str,
63-
**kwargs: Any,
64-
) -> None:
65-
super().__init__(
66-
resource_id=resource_id,
67-
resource_path='acts',
68-
**kwargs,
69-
)
59+
def __init__(self, *, resource_id: str, **kwargs: Any) -> None:
60+
super().__init__(resource_id=resource_id, resource_path='acts', **kwargs)
7061

7162
def get(self) -> Actor | None:
7263
"""Retrieve the Actor.
@@ -519,17 +510,8 @@ class ActorClientAsync(ResourceClientAsync):
519510
via an appropriate method on the `ApifyClientAsync` class.
520511
"""
521512

522-
def __init__(
523-
self,
524-
*,
525-
resource_id: str,
526-
**kwargs: Any,
527-
) -> None:
528-
super().__init__(
529-
resource_id=resource_id,
530-
resource_path='acts',
531-
**kwargs,
532-
)
513+
def __init__(self, *, resource_id: str, **kwargs: Any) -> None:
514+
super().__init__(resource_id=resource_id, resource_path='acts', **kwargs)
533515

534516
async def get(self) -> Actor | None:
535517
"""Retrieve the Actor.

src/apify_client/_resource_clients/actor_collection.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,8 @@ class ActorCollectionClient(ResourceClient):
2020
method on the `ApifyClient` class.
2121
"""
2222

23-
def __init__(
24-
self,
25-
**kwargs: Any,
26-
) -> None:
27-
super().__init__(
28-
resource_path='acts',
29-
**kwargs,
30-
)
23+
def __init__(self, **kwargs: Any) -> None:
24+
super().__init__(resource_path='acts', **kwargs)
3125

3226
def list(
3327
self,
@@ -157,14 +151,8 @@ class ActorCollectionClientAsync(ResourceClientAsync):
157151
method on the `ApifyClientAsync` class.
158152
"""
159153

160-
def __init__(
161-
self,
162-
**kwargs: Any,
163-
) -> None:
164-
super().__init__(
165-
resource_path='acts',
166-
**kwargs,
167-
)
154+
def __init__(self, **kwargs: Any) -> None:
155+
super().__init__(resource_path='acts', **kwargs)
168156

169157
async def list(
170158
self,

src/apify_client/_resource_clients/actor_env_var.py

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,8 @@ class ActorEnvVarClient(ResourceClient):
3030
via an appropriate method on the `ActorVersionClient` class.
3131
"""
3232

33-
def __init__(
34-
self,
35-
*,
36-
resource_id: str,
37-
**kwargs: Any,
38-
) -> None:
39-
super().__init__(
40-
resource_id=resource_id,
41-
resource_path='env-vars',
42-
**kwargs,
43-
)
33+
def __init__(self, *, resource_id: str, **kwargs: Any) -> None:
34+
super().__init__(resource_id=resource_id, resource_path='env-vars', **kwargs)
4435

4536
def get(self) -> EnvVar | None:
4637
"""Return information about the Actor environment variable.
@@ -99,17 +90,8 @@ class ActorEnvVarClientAsync(ResourceClientAsync):
9990
via an appropriate method on the `ActorVersionClientAsync` class.
10091
"""
10192

102-
def __init__(
103-
self,
104-
*,
105-
resource_id: str,
106-
**kwargs: Any,
107-
) -> None:
108-
super().__init__(
109-
resource_id=resource_id,
110-
resource_path='env-vars',
111-
**kwargs,
112-
)
93+
def __init__(self, *, resource_id: str, **kwargs: Any) -> None:
94+
super().__init__(resource_id=resource_id, resource_path='env-vars', **kwargs)
11395

11496
async def get(self) -> EnvVar | None:
11597
"""Return information about the Actor environment variable.

src/apify_client/_resource_clients/actor_env_var_collection.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,8 @@ class ActorEnvVarCollectionClient(ResourceClient):
1717
appropriate method on the `ActorVersionClient` class.
1818
"""
1919

20-
def __init__(
21-
self,
22-
**kwargs: Any,
23-
) -> None:
24-
super().__init__(
25-
resource_path='env-vars',
26-
**kwargs,
27-
)
20+
def __init__(self, **kwargs: Any) -> None:
21+
super().__init__(resource_path='env-vars', **kwargs)
2822

2923
def list(self) -> ListOfEnvVars:
3024
"""List the available Actor environment variables.
@@ -74,14 +68,8 @@ class ActorEnvVarCollectionClientAsync(ResourceClientAsync):
7468
appropriate method on the `ActorVersionClientAsync` class.
7569
"""
7670

77-
def __init__(
78-
self,
79-
**kwargs: Any,
80-
) -> None:
81-
super().__init__(
82-
resource_path='env-vars',
83-
**kwargs,
84-
)
71+
def __init__(self, **kwargs: Any) -> None:
72+
super().__init__(resource_path='env-vars', **kwargs)
8573

8674
async def list(self) -> ListOfEnvVars:
8775
"""List the available Actor environment variables.

src/apify_client/_resource_clients/actor_version.py

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,8 @@ class ActorVersionClient(ResourceClient):
2525
appropriate method on the `ActorClient` class.
2626
"""
2727

28-
def __init__(
29-
self,
30-
*,
31-
resource_id: str,
32-
**kwargs: Any,
33-
) -> None:
34-
super().__init__(
35-
resource_id=resource_id,
36-
resource_path='versions',
37-
**kwargs,
38-
)
28+
def __init__(self, *, resource_id: str, **kwargs: Any) -> None:
29+
super().__init__(resource_id=resource_id, resource_path='versions', **kwargs)
3930

4031
def get(self) -> Version | None:
4132
"""Return information about the Actor version.
@@ -134,17 +125,8 @@ class ActorVersionClientAsync(ResourceClientAsync):
134125
appropriate method on the `ActorClientAsync` class.
135126
"""
136127

137-
def __init__(
138-
self,
139-
*,
140-
resource_id: str,
141-
**kwargs: Any,
142-
) -> None:
143-
super().__init__(
144-
resource_id=resource_id,
145-
resource_path='versions',
146-
**kwargs,
147-
)
128+
def __init__(self, *, resource_id: str, **kwargs: Any) -> None:
129+
super().__init__(resource_id=resource_id, resource_path='versions', **kwargs)
148130

149131
async def get(self) -> Version | None:
150132
"""Return information about the Actor version.

src/apify_client/_resource_clients/actor_version_collection.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,8 @@ class ActorVersionCollectionClient(ResourceClient):
2323
on the `ActorClient` class.
2424
"""
2525

26-
def __init__(
27-
self,
28-
**kwargs: Any,
29-
) -> None:
30-
super().__init__(
31-
resource_path='versions',
32-
**kwargs,
33-
)
26+
def __init__(self, **kwargs: Any) -> None:
27+
super().__init__(resource_path='versions', **kwargs)
3428

3529
def list(self) -> ListOfVersions:
3630
"""List the available Actor versions.
@@ -104,14 +98,8 @@ class ActorVersionCollectionClientAsync(ResourceClientAsync):
10498
on the `ActorClientAsync` class.
10599
"""
106100

107-
def __init__(
108-
self,
109-
**kwargs: Any,
110-
) -> None:
111-
super().__init__(
112-
resource_path='versions',
113-
**kwargs,
114-
)
101+
def __init__(self, **kwargs: Any) -> None:
102+
super().__init__(resource_path='versions', **kwargs)
115103

116104
async def list(self) -> ListOfVersions:
117105
"""List the available Actor versions.

src/apify_client/_resource_clients/build.py

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,8 @@ class BuildClient(ResourceClient):
2121
instance via an appropriate method on the `ApifyClient` class.
2222
"""
2323

24-
def __init__(
25-
self,
26-
*,
27-
resource_id: str,
28-
**kwargs: Any,
29-
) -> None:
30-
super().__init__(
31-
resource_id=resource_id,
32-
resource_path='actor-builds',
33-
**kwargs,
34-
)
24+
def __init__(self, *, resource_id: str, **kwargs: Any) -> None:
25+
super().__init__(resource_id=resource_id, resource_path='actor-builds', **kwargs)
3526

3627
def get(self) -> Build | None:
3728
"""Return information about the Actor build.
@@ -122,17 +113,8 @@ class BuildClientAsync(ResourceClientAsync):
122113
instance via an appropriate method on the `ApifyClientAsync` class.
123114
"""
124115

125-
def __init__(
126-
self,
127-
*,
128-
resource_id: str,
129-
**kwargs: Any,
130-
) -> None:
131-
super().__init__(
132-
resource_id=resource_id,
133-
resource_path='actor-builds',
134-
**kwargs,
135-
)
116+
def __init__(self, *, resource_id: str, **kwargs: Any) -> None:
117+
super().__init__(resource_id=resource_id, resource_path='actor-builds', **kwargs)
136118

137119
async def get(self) -> Build | None:
138120
"""Return information about the Actor build.

src/apify_client/_resource_clients/build_collection.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,8 @@ class BuildCollectionClient(ResourceClient):
1515
`ApifyClient` class.
1616
"""
1717

18-
def __init__(
19-
self,
20-
**kwargs: Any,
21-
) -> None:
22-
super().__init__(
23-
resource_path='actor-builds',
24-
**kwargs,
25-
)
18+
def __init__(self, **kwargs: Any) -> None:
19+
super().__init__(resource_path='actor-builds', **kwargs)
2620

2721
def list(
2822
self,
@@ -59,14 +53,8 @@ class BuildCollectionClientAsync(ResourceClientAsync):
5953
`ApifyClientAsync` class.
6054
"""
6155

62-
def __init__(
63-
self,
64-
**kwargs: Any,
65-
) -> None:
66-
super().__init__(
67-
resource_path='actor-builds',
68-
**kwargs,
69-
)
56+
def __init__(self, **kwargs: Any) -> None:
57+
super().__init__(resource_path='actor-builds', **kwargs)
7058

7159
async def list(
7260
self,

src/apify_client/_resource_clients/dataset.py

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,8 @@ class DatasetClient(ResourceClient):
6666
via an appropriate method on the `ApifyClient` class.
6767
"""
6868

69-
def __init__(
70-
self,
71-
*,
72-
resource_id: str | None = None,
73-
**kwargs: Any,
74-
) -> None:
75-
super().__init__(
76-
resource_id=resource_id,
77-
resource_path='datasets',
78-
**kwargs,
79-
)
69+
def __init__(self, *, resource_id: str | None = None, **kwargs: Any) -> None:
70+
super().__init__(resource_id=resource_id, resource_path='datasets', **kwargs)
8071

8172
def get(self) -> Dataset | None:
8273
"""Retrieve the dataset.
@@ -695,17 +686,8 @@ class DatasetClientAsync(ResourceClientAsync):
695686
via an appropriate method on the `ApifyClientAsync` class.
696687
"""
697688

698-
def __init__(
699-
self,
700-
*,
701-
resource_id: str | None = None,
702-
**kwargs: Any,
703-
) -> None:
704-
super().__init__(
705-
resource_id=resource_id,
706-
resource_path='datasets',
707-
**kwargs,
708-
)
689+
def __init__(self, *, resource_id: str | None = None, **kwargs: Any) -> None:
690+
super().__init__(resource_id=resource_id, resource_path='datasets', **kwargs)
709691

710692
async def get(self) -> Dataset | None:
711693
"""Retrieve the dataset.

src/apify_client/_resource_clients/dataset_collection.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,8 @@ class DatasetCollectionClient(ResourceClient):
1616
appropriate method on the `ApifyClient` class.
1717
"""
1818

19-
def __init__(
20-
self,
21-
**kwargs: Any,
22-
) -> None:
23-
super().__init__(
24-
resource_path='datasets',
25-
**kwargs,
26-
)
19+
def __init__(self, **kwargs: Any) -> None:
20+
super().__init__(resource_path='datasets', **kwargs)
2721

2822
def list(
2923
self,
@@ -73,14 +67,8 @@ class DatasetCollectionClientAsync(ResourceClientAsync):
7367
appropriate method on the `ApifyClientAsync` class.
7468
"""
7569

76-
def __init__(
77-
self,
78-
**kwargs: Any,
79-
) -> None:
80-
super().__init__(
81-
resource_path='datasets',
82-
**kwargs,
83-
)
70+
def __init__(self, **kwargs: Any) -> None:
71+
super().__init__(resource_path='datasets', **kwargs)
8472

8573
async def list(
8674
self,

0 commit comments

Comments
 (0)