chore: initialize containerized Python learning workbook (2026 DevOps/SRE)
This commit is contained in:
commit
ae4c421815
63 files changed
+1273
No files matched your search
@@ -0,0 +1,18 @@
|
||||
# ruff: noqa: B006
|
||||
"""Celowo wadliwy kod w stylu 'szybkiego draftu z AI'. Audytuj i napraw!"""
|
||||
|
||||
|
||||
def add_tag(tag: str, tags: list[str] = []) -> list[str]:
|
||||
# BUG: mutowalny argument domyślny współdzielony między wywołaniami!
|
||||
tags.append(tag)
|
||||
return tags
|
||||
|
||||
|
||||
def average(values: list[float]) -> float | None:
|
||||
# BUG: ZeroDivisionError dla pustej listy
|
||||
return sum(values) / len(values)
|
||||
|
||||
|
||||
def extract_bearer_token(auth_header: str) -> str | None:
|
||||
# BUG: IndexError bez spacji, nie sprawdza prefiksu "Bearer ", przepuszcza pusty token
|
||||
return auth_header.split(" ")[1]
|
||||
Reference in new issue
Block a user