@Neblk · Post #2254 · 04.03.2025 г., 16:24
https://github.com/containers/podman/issues/24341 #HomeLab
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #418 · 9 мар.
Оператор pipe позволяет писать более компактный код, реализуя логику объединения данных (Union). Важно помнить, что его поведение зависит от контекста. Побитовые операции (логическое OR) result = 5 | 3 # 5 (0101) | 3 (0011) = 7 (0111) Самое главное - не путать с оператором or, это другое! Объединение множеств set_a = {1, 2, 3} set_b = {3, 4, 5} set_c = set_a | set_b # {1, 2, 3, 4, 5} set_c |= {5, 6} # {1, 2, 3, 4, 5, 6} Слияние словарей dict_1 = {"a": 1, "b": 2} dict_2 = {"b": 3, "c": 4} merged = dict_1 | dict_2 # {'a': 1, 'b': 3, 'c': 4} merged |= {"d": 5} # {'a': 1, 'b': 3, 'c': 4, 'd': 5} Аннотации типов, заменяет Union def process_data(value: int | str) -> None: print(value) Допустимо использовать в isinstance или issubclass isinstance(3, int | float) # True Паттерн-матчинг status_code = 404 match status_code: case 200 | 201 | 204: print("OK") case 400 | 404 | 500: print("ERROR") Для использования в своих классах требуется переопределить метод __or__ Так же нашел библиотеку pipe которая добавляет еще много возможностей. Рекомендую ознакомиться ;) #basic
Hashtags
Пребарај: #homelab
@Neblk · Post #2254 · 04.03.2025 г., 16:24
https://github.com/containers/podman/issues/24341 #HomeLab
Hashtags
@Neblk · Post #2245 · 10.02.2025 г., 17:03
https://www.kernel.org/doc/html/latest/hwmon/nct6775.html #Homelab
Hashtags
@Neblk · Post #2097 · 20.09.2024 г., 01:22
https://guacamole.apache.org/doc/gug/introduction.html #Homelab
Hashtags
@Neblk · Post #2096 · 20.09.2024 г., 01:07
https://stackoverflow.com/questions/32090974/what-does-the-shcannot-set-terminal-process-group-1-inappropriate-ioctl-for #Homelab
Hashtags
@Neblk · Post #2095 · 20.09.2024 г., 01:07
https://stackoverflow.com/questions/11821378/what-does-bashno-job-control-in-this-shell-mean #Homelab
Hashtags
@Neblk · Post #2094 · 20.09.2024 г., 01:06
https://kl.wtf/posts/2022/03/12/login-managers-an-introduction.html #Homelab
Hashtags
@Neblk · Post #2090 · 15.09.2024 г., 13:34
https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html#StartLimitIntervalSec=interval #Homelab
Hashtags
@Neblk · Post #2081 · 09.09.2024 г., 03:31
https://www.kernel.org/doc/html/latest/admin-guide/pm/intel_uncore_frequency_scaling.html #Homelab
Hashtags
@Neblk · Post #2079 · 03.09.2024 г., 14:59
https://www.redhat.com/sysadmin/quadlet-podman #Homelab
Hashtags
@Neblk · Post #1973 · 13.05.2024 г., 07:34
https://www.dongvps.com/2022-11-07/tailscale-exit-node-route/ #HomeLab
Hashtags
@Neblk · Post #1970 · 13.05.2024 г., 02:45
https://pve.proxmox.com/wiki/Dynamic_Memory_Management #HomeLab
Hashtags
@Neblk · Post #2220 · 09.12.2024 г., 04:17
https://github.com/zerodays/linux-kiosk-mode #嵌入式系统#信息技术基础#Homelab