techhub.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A hub primarily for passionate technologists, but everyone is welcome

Administered by:

Server stats:

4.6K
active users

#pycharm

2 posts2 participants0 posts today
Continued thread
def is_valid_key(obj) -> TypeGuard[Key]:
return (
obj is None
or isinstance(obj, (str, int, float))
or (
isinstance(obj, (tuple, frozenset))
and all(is_valid_key(elem) for elem in obj)
)
)


class KeyClass:
def __new__(cls, that: Key) -> Key:
return that

def __instancecheck__(self, instance) -> bool:
return is_valid_key(instance)

Having to pick whether to use Key or KeyClass kinda sucks and I want to use just the class everywhere, but it seems like #PyCharm 's type checker can't tell that, when I annotate something KeyClass, that means it shouldn't complain when I pass in a string.

Is this a PyCharm limitation, or am I using types wrong?

🌗 AI 寫入日誌是我最喜歡的應用案例
➤ 簡潔高效的本地 AI 程式碼日誌生成
newsletter.vickiboykis.com/arc
本文探討了 JetBrains 在 PyCharm IDE 中內建的 AI 程式碼自動完成功能,特別是其在撰寫日誌方面的優勢。作者指出,此功能不僅提升了開發效率,更能產生清晰簡潔的日誌訊息,甚至優於人工撰寫。此外,此 AI 模型是本地運作,強調了對模型大小和速度的限制,以及專注於程式碼完成任務的優勢,與通用大型語言模型截然不同。
+ 這種本地 AI 自動完成日誌的功能真的太實用了!我以前寫日誌總是覺得很麻煩,現在可以省下很多時間,而且生成的日誌也更清晰。
+ 我很欣賞 JetBrains 專注於特定領域的 AI 應用,而不是一味追求通用性。這種做法讓他們可以在有限的資源下,提供更出色的使用者體驗。
#人工智慧 #程式開發 #PyCharm #日誌記錄

Normcore Tech · My favorite use-case for AI is writing logsBy Normcore Tech
Continued thread

Для #pycharm почему-то обязательно нужен был gsettings (пакет glib). Непонимаю, почему остальным он не нужен, как это работает и тп, но пофиксить получилось

It's 4 AM. Couldn't sleep (thanks, chemo! /s). We're in the middle of a heat wave. My part of the world is still asleep.

I'm sitting here building a web scraper using #Pycharm and their AI add-ons. Mynoises.net is gently playing in the background.

I forgot how much fun this is.