TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

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

Резултати

Пронајдени 10 слични објави

Пребарај: #box

当前筛选 #box清除筛选
Main Event | Sport News

@maineventnews · Post #96 · 22.07.2024 г., 20:01

Jake Paul knocked out Mike Perry in the 6th round 👊 I expected to win. I should have won in the first round, but Perry survived. Mike Tyson, you're next, sign the contract. #Box 👁Subscribe to Main Event | Sport News

Hashtags

Main Event | Sport News

@maineventnews · Post #60 · 18.07.2024 г., 13:01

Jake Paul on the fight with Mike Perry: "Maybe at the beginning, he’ll land a couple of heavy shots, maybe he’ll be all wild and unpredictable, but as the fight progresses, I’ll start breaking him down with my footwork, jab, and body shots." #Box 👁Subscribe to Main Event | Sport News

Hashtags

Main Event | Sport News

@maineventnews · Post #52 · 17.07.2024 г., 12:00

Diaz Sues Organizers of Fight with Masvidal #box#mma Nate Diaz has filed a lawsuit against the organizers of the fight with Jorge Masvidal. Nate claims he had an agreement for a $10,000,000 payout for the fight. He received an advance payment of $1,000,000, with the remaining $9,000,000 to be paid after the fight. The lawsuit states that the company is refusing to make the payments, claiming that the event was unprofitable. 👁Subscribe to Main Event | Sport News

Hashtags

科技&趣闻&杂记

@kejiqu · Post #3472 · 26.05.2025 г., 08:08

ChatGPT深度研究功能现在可以连接并读取来自Box和Dropbox网盘中的数据 据 OpenAI 官方发布的消息,目前 ChatGPT 深度研究功能已支持连接 Box 和 Dropbox 平台的账号,添加账号并授权后 ChatGPT 可以通过读取用户网盘中存储的文件来优化研究报告。 用户在连接账号后可以将 Dropbox 等网盘的指定路径作为数据来源,这样 ChatGPT 在进行深度研究功能时也会读取这些文件,如果有重要数据则可能会将这些数据添加到研究报告中。 用户自己提供数据还有个好处是 ChatGPT 可以生成更契合用户需要的研究报告,用户提供的数据越多并通过提示词引导 ChatGPT,最终生成的效果可能要比 ChatGPT 直接从互联网上抓取数据更好。 另外 OpenAI 也准备为 ChatGPT 带来 MCP 协议的支持,到时候 ChatGPT 也可以通过 MCP 连接外部应用程序获取数据,到时候无论是日常提问还是撰写深度研究报告可能都会更方便。蓝点网 🏷#ChatGPT#Box#Dropbox 📢频道👥群组📝投稿

探索号

@seeker_rc · Post #19595 · 04.05.2026 г., 14:55

给 sing-box config 写了一套完整的 TypeScript 类型 以前需要同时维护几份 sing-box config 时搓的东西,目前已经维护一年半了。 ⦁ 主要特点是通过 ts 的泛型校验一下 tag ,sing-box tag 太多了,写的时候经常忘。 ⦁ 用 ts 的话可以看一下 playground ,其实就是把配置拆碎,然后组合成一份 sing-box config ,这样子维护几份 sing-box config 就比较省力(因为几份 config 里会重用大部分 rule-set, outbounds 等等)。 ⦁ 如果没这个需求也可以直接用 json schema ,直接在现有的 json 里加上就好了,在 LSP 加持下... via V2EX 分享创造 标签: #sing#box#config ⚡️探索号频道 ⚡️探索者频道 ⚡️探索者交流群 ⚡️ Youtube 频道:科技探索者 每天推荐有趣内容,欢迎订阅、转发。