Skip to content

Commit 95b5733

Browse files
authored
Merge branch 'master' into scrapy-mongodb
2 parents f2b6ae7 + bbd1ff9 commit 95b5733

File tree

13 files changed

+143
-20
lines changed

13 files changed

+143
-20
lines changed
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
click==8.1.3
2-
Flask==2.1.2
3-
itsdangerous==2.1.2
4-
Jinja2==3.1.2
5-
MarkupSafe==2.1.1
6-
Werkzeug==2.1.2
1+
blinker==1.8.2
2+
click==8.1.7
3+
Flask==3.0.3
4+
itsdangerous==2.2.0
5+
Jinja2==3.1.4
6+
MarkupSafe==2.1.5
7+
Werkzeug==3.0.3

python-async-iterators/async_csv.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,16 @@
77
class AsyncCSVIterator:
88
def __init__(self, path):
99
self.path = path
10-
self.file_was_read = False
10+
self.reader = None
1111

1212
def __aiter__(self):
1313
return self
1414

1515
async def __anext__(self):
16-
if not self.file_was_read:
16+
if self.reader is None:
1717
async with aiofiles.open(self.path, mode="r") as file:
1818
lines = await file.readlines()
1919
self.reader = csv.reader(lines)
20-
self.file_was_read = True
2120
try:
2221
return next(self.reader)
2322
except StopIteration:

python-async-iterators/compress.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ async def main(directory, zip_name="output.zip"):
1818
await archive.write(chunk)
1919

2020

21-
directory = Path()
21+
directory = Path.cwd()
2222
asyncio.run(main(directory))

python-class/car.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def brake(self, value):
3434
print(f"Braking to {self.speed} km/h...")
3535

3636
def __str__(self):
37-
return f"{self.make}, {self.model}, {self.color}: ({self.year})"
37+
return f"{self.make} {self.model}, {self.color} ({self.year})"
3838

3939
def __repr__(self):
4040
return (

python-class/circle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ def radius(self, value):
1616
self._radius = value
1717

1818
def area(self):
19-
return round(math.pi * self._radius**2, 2)
19+
return math.pi * self._radius**2

python-class/mro.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
class A:
22
def method(self):
3-
print("A.method")
3+
print("A.method()")
44

55

66
class B(A):
77
def method(self):
8-
print("B.method")
8+
print("B.method()")
99

1010

1111
class C(A):
1212
def method(self):
13-
print("C.method")
13+
print("C.method()")
1414

1515

1616
class D(B, C):

python-class/robot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ def __init__(self):
3737
self.position = 0
3838

3939
def move_up(self, distance=1):
40-
self.position += 1
40+
self.position += distance
4141
print(f"Moving arm {distance} cm up...")
4242

4343
def move_down(self, distance=1):
44-
self.position -= 1
44+
self.position -= distance
4545
print(f"Moving arm {distance} cm down...")
4646

4747
def weld(self):

python-class/shapes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def __init__(self, radius):
2121
self.radius = radius
2222

2323
def area(self):
24-
return round(math.pi * self.radius**2, 2)
24+
return math.pi * self.radius**2
2525

2626

2727
class Square:
@@ -31,4 +31,4 @@ def __init__(self, side):
3131
self.side = side
3232

3333
def area(self):
34-
return round(self.side**2, 2)
34+
return self.side**2

python-class/square.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ def side(self, value):
1313
self._side = value
1414

1515
def calculate_area(self):
16-
return round(self._side**2, 2)
16+
return self._side**2

python-walrus-operator/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# The Walrus Operator: Python's Assignment Expressions
2+
3+
This folder contains the sample code used in the RealPython tutorial [The Walrus Operator: Python's Assignment Expressions](https://realpython.com/python-walrus-operator/).
4+
5+
## About the Author
6+
7+
Geir Arne Hjelle - Email: [email protected]
8+
9+
## License
10+
11+
Distributed under the MIT license. See `LICENSE` for more information.

0 commit comments

Comments
 (0)