#Pythonic

N-gated Hacker Newsngate
2025-05-24

DumPy: Because embracing your inner dolt is the new way of life. 🤪📉 Want to run fast on without a single brain cell firing? This is the for you, where "thinking" is officially a deprecated feature. 😂🧠
dynomight.net/dumpy/

2025-04-07

Ursina: Создание умных NPC через поведенческие деревья (Часть 2)

В первой части мы разобрали основы Ursina и создали простую 3D-игру. Теперь перейдем к более сложной механике — искусственному интеллекту для NPC с помощью поведенческих деревьев (Behavior Trees).

habr.com/ru/articles/898360/

#ursina_engine #ursina #python #python3 #python_3 #pythonic #python_class #python_tutor #game_development #gamedev

2025-01-27

[Перевод] Чистый код в Python

Всем привет! Это перевод статьи Clean Code in Python . В данной статье Nik Tomazic рассказывает о чистом коде, его преимуществах, различных стандартах и принципах, но что самое главное– он дает общие рекомендации по написанию чистого кода. Прочитав данную статью в оригинале, я понял, что это именно то, что я хотел бы прочитать в самом начале своего пути разработки на Python. Именно это и вдохновило меня на создание первого перевода, а вместе с этим, и первой публикации на Хабре.

habr.com/ru/articles/877118/

#чистый_код_Python #PEP_8 #Pythonic #DRY #SOLID #форматирование_кода #модульность_в_Python #Дзен_Python #python

Mr. Lance E Sloan (IRL) 👤sloanlance
2025-01-15

@villares @AlSweigart @nedbat
Thanks! Although it may be small, it's not exactly . I also just realized that it might not be very efficient. Maybe we should check with `timeit`.

Mr. Lance E Sloan (IRL) 👤sloanlance
2025-01-14

@AlSweigart @nedbat You inspired me to hack a way to ensure `a`, `b`, and `c` are distinct. I came up with…

```
len(set((a, b, c))) == 3
```

I suspect that's bordering on obfuscated code. Probably not .

2024-12-24

Простое управление настройками приложения в проекте на django

Как добавить кучу настроек для администратора в свой проект на django без дополнительных сервисов feature-toggle и потом в них не потеряться.

habr.com/ru/articles/869432/

#настройки #конфиги #python #pythonic #featuretoggle

2024-11-06

@AliveDevil

Oof. Yes, this code

> if self._unique_id == 'none':

is glaringly un-#Pythonic to this reader.

I venture to say it's even a mistake, because the only place that attribute gets set is earlier:

> self._unique_id = kwargs.get('unique_id')

which will return the `None` object if 'unique_id' is not in `kwargs`.

So that conditional test should just be using the normal Pythonic:

> if self._unique_id is None:

Which is why the `dict.get` method returns `None` when the key isn't found.

2024-10-16

Ok, my new mission is convincing #rstats people, especially those involved with @rOpenSci, that they are indeed research software engineers and that they should get involved in the disproportionately #pythonic (in my opinion) @us_rse

2024-08-29

10 кубиков синтаксического сахара

В питоне очень много полезного и интересного синтаксического сахара. Настолько много, что у неподготовленных пользователей может случиться сахарный диабет. Здесь вы увидите несколько уникального для питона синтаксического сахара, его примеры правильного и неправильного применения.

habr.com/ru/articles/839558/

#синтаксический_сахар #синтаксис #языковые_конструкции #pythonic

#TheMetalDogArticleList #BraveWords Exclusive: Saskatoon’s PYTHONIC Premieres “Pills” Single bravewords.com/news/exclusi... #Pythonic #Saskatoon

🤘 The Metal Dog 🤘TheMetalDog
2024-08-16
2024-06-28

Thanks to @raspbeguy for bearing with me toward a more #pythonic and portable #VenC #package. Glad we made it and fix the issues inherited from v3.2.2 announced there :

linuxfr.org/news/mise-a-jour-d

VenC is now available in version 3.2.4 and has a working #AlpineOS package <3

#VenC #freesoftware #logiciellibre #python #alpine #alpineos #illustration #dessin #art #artlibre

2024-06-05
if you are taking python interview for a 4-5+ yr experience developer wiho has all the modern fancy packages listed out in their CV but they can't write good #pythonic code with just the language and no external dependencies... #aita? for never asking textbook questions but creating simple coding exercises which require no leet level algorithms etiher? not a single candidate went through without struggling. i have stopped believing in the fancy packages they are putting in python developer CVs.
Peter Bittnerpeterbittner
2024-05-24

Interested in deploying to - or VMs or bare metal - without wrangling with thousand lines of code? My talk on starts in less than 30 minutes. See you there! 2024.pycon.it/en/event/pythoni @ubuntu

Summon The JSONsummonthejson
2024-03-03

In Python, a breakpoint is a designated point in your code where the execution will pause, allowing you to inspect the state of the program, variables, and perform interactive debugging. The purpose of the breakpoint function is to facilitate debugging by providing a convenient way to set breakpoints in your code.

2024-01-13

How should I read #credentials into a #python script?

What did you choose and why?

Is there the one #pythonic way?

What is proof for future (cronjob, container, VM) not only if I start it manually?

#fedihelp

@skimlines @cs

It's fine for #lists - but it's not the most "#Pythonic" way to do this, at least for lists. Like some other built-in objects, lists have a method `.copy()` which does what it says - returns a #copy of the #object. That's more obvious than using `...[:]` when reading the code, so that tends to be the preferred way in Python.

Unfortunately, #tuples don't have .copy(). They do support [:]. 🤷

[...]

2023-11-13

@cazabon

I was trying to test performance to see which is better.

#Pythonic

@encthenet

Of course, you didn't say why you didn't want to use the most #Pythonic of the possibilities...

`"".join([list of strings])`

?

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst