506 place 0

825 Python: Почему строки в if-else — это плохо, переходим на Enum

Habr
enamored_poc @ Habr · 01/08/2026 03:23 EDT

Python: Почему строки в if-else — это плохо, переходим на Enum

Бывало такое: сидишь час над багом, перебираешь функции, а в итоге выясняется, что ты просто опечатался в одном слове? В одном месте статус заказа был "shipped", а в другом — "shiped" с одной «p». Python промолчал, потому что для него это просто две разные строки. А для тебя это — потерянный вечер. Сегодня разберем, как модуль enum избавляет от этой боли и делает код в разы чище. Читать далее

To see detailed statistics for the news please log in »

Read the original

Add your comment
You must be logged in with Facebook to read and write comments.

A newsletter a day!

You may get 10 most important news around midday in daily newsletter. Press the button and we will send you the most important news only, no spam attached.

or register

LIKE us on Facebook so you won't miss the most important news of the day!

News from the same source
Habr Habr
Business Insider
Lee Chong Ming @ Business Insider 1 place · today 01:01 EDT

Cursor's most important AI features started as side projects engineers built themselves, says its engineering head

Some of Cursor's biggest AI features didn't start on a roadmap. They were bottom-up projects built by its engineers, says Jason Ginsberg. Read more

1,477 fresh

🔮
09.01.2026 ♏︎ Dear Scorpio, today will bring you a variety of impressions and opportunities in different areas... Read more ›
Wired
Matt Giles, Tim Marchman @ Wired 1 place · 01/08/2026 22:19 EDT

ICE Agent Who Reportedly Shot Renee Good Was a Firearms Trainer, Per Testimony

Jonathan Ross told a federal court in December about his professional background, including “hundreds” of encounters with drivers during enforcement actions, according to testimony obtained by WIRED. Read more

618 fresh

Wired
Andy Greenberg, Lily Hay Newman @ Wired 2 place · 01/08/2026 12:34 EDT

How to Protest Safely in the Age of Surveillance

Law enforcement has more tools than ever to track your movements and access your communications. Here’s how to protect your privacy if you plan to protest. Read more

509

Vox
Eric Levitz @ Vox 1 place · 01/08/2026 18:45 EDT

Trump’s menacingly dishonest response to the Minnesota ICE shooting

Renee Nicole Good sat idling in her car Wednesday, observing an ongoing ICE operation. The 37-year-old then attempted to drive away, reportedly at the instruction of one federal agent on scene. In response, another ICE officer shot her to death.  It is possible that we still lack some significant context for Good’s killing. But her […] Read more

428 fresh

Wired
Molly Higgins @ Wired 3 place · today 01:10 EDT

$20 Chewy Promo Code | January 2026

Explore Chewy coupon codes for $20 off $49 orders, 50% off pet food, and more winter 2026 discounts. Read more

416 fresh

Business Insider
Dan Whateley @ Business Insider 2 place · 01/08/2026 23:42 EDT

TikTok is splitting its US staff into different companies as it prepares for a sale

TikTok told some US staff that they will work for a new global entity that is not a part of the new joint venture run by Oracle and others. Read more

378 fresh

Business Insider
Kristine Villarroel @ Business Insider 3 place · 01/08/2026 15:18 EDT

19 of the highest-paid mayors in the US, ranked by salary

Zohran Mamdani earns $258,750 as New York City's mayor, putting him among the country's top-earning mayors. Read more

377

Slashdot
BeauHD @ Slashdot 1 place · 01/08/2026 22:30 EDT

Some Super-Smart Dogs Can Learn New Words Just By Eavesdropping

An anonymous reader quotes a report from NPR: [I]t turns out that some genius dogs can learn a brand new word, like the name of an unfamiliar toy, by just overhearing brief interactions between two people. What's more, these "gifted" dogs can learn the name of a new toy even if they first hear this word when the toy is out of sight -- as long as their favorite human... Read more

368 fresh

The Verge
Stevie Bonifield @ The Verge 1 place · 01/08/2026 09:42 EDT

Bose is open-sourcing its old smart speakers instead of bricking them

In a surprisingly user-friendly move, Bose has announced it will be open-sourcing the API documentation for its SoundTouch smart speakers, which were slated to lose official support on February 18th, as reported by Ars Technica. Bose has also moved that date back to May 6th, 2026. When cloud support ends, an update to the SoundTouch […] Read more

318

Wired
David Gilbert @ Wired · 01/08/2026 15:17 EDT

MAGA Is Already Rewriting the ICE Shooting in Minneapolis

The sanctioned government narrative of the Minneapolis shooting diverts wildly from video footage of the incident shared online. Read more

307

GSMArena.com
GSMArena.com 1 place · today 00:06 EDT

Lava teases new smartphone with a screen on the back, Xiaomi-style

Lava took a look at the Xiaomi 17 Pro and Xiaomi 17 Pro Max and decided it wants in on that rear screen action. Hence, the brand is now teasing an upcoming smartphone that also has a display on the back, integrated into a big camera island. This being Lava, we expect the phone to be a mid-ranger, which explains the much smaller screen compared to Xiaomi's flagships. We can... Read more

298 fresh

Business Insider
Shubhangi Goel @ Business Insider · today 00:02 EDT

Bessent: Private equity firms won't have to sell single-family home rentals

The Treasury Secretary said that Trump's proposal to keep big players from buying single-family homes would not force them to sell current holdings. Read more

277 fresh

Wired
David Gilbert @ Wired · 01/08/2026 11:33 EDT

People Are Using AI to Falsely Identify the Federal Agent Who Shot Renee Good

Online detectives are inaccurately claiming to have identified the federal agent who shot and killed a 37-year-old woman in Minnesota based on AI-manipulated images. Read more

271

Wired
Caroline Haskins @ Wired · 01/08/2026 15:25 EDT

Why Are Grok and X Still Available in App Stores?

Elon Musk’s chatbot has been used to generate thousands of sexualized images of adults and apparent minors. Apple and Google have removed other “nudify” apps—but continue to host X and Grok. Read more

228

GSMArena.com
GSMArena.com 2 place · 01/08/2026 22:47 EDT

Oppo Find N7 to compete head-on with the iPhone Fold with a wider form factor

Oppo is expected to unveil the Find N6 in February, but according to a new rumor from "a trusted industry insider" this won't be its only foldable device launching this year. Instead, it will be joined in September by the Find N7, which will also be a book-style foldable, but with a twist. This one will be wider, just like the iPhone Fold, which is most likely being announced in... Read more

206 fresh

Business Insider
Julia Hornstein,Jack Newsham @ Business Insider · 01/08/2026 14:52 EDT

Google cofounders Sergey Brin and Larry Page moved an LLC out of California ahead of proposed billionaire's tax

The LLC moved as California's ultrarich weigh leaving ahead of a proposed tax on billionaires that would take effect retroactively starting January 1. Read more

205

The most popular news from the same source for the last week
Habr Habr
Habr
onlyahead @ Habr 2 place · 01/04/2026 05:13 EDT

Израиль первыми в мире развернул боевые лазеры: Гонка вооружений снова началась

И теперь выстрел из ПВО стоит пару долларов, вместо сотен тысяч на одну ракету. О том, как работает система Железный Луч, почему ученым ранее не удавалось построить компактные лазеры, и как остальной мир строит свои военные технологии будущего, вплоть до насекомых-киборгов. Читать далее Read more

29

Habr
pink0D @ Habr 1 place · 01/02/2026 12:32 EDT

Прокачиваем LEGO-машинки с помощью Arduino

В этой статье попробуем разобраться, почему игрушечные машинки за условные 1000р ездят лучше, чем серьезные модели из конструкторов с электрикой за 10000р, и что с этим можно сделать, если вы разбираетесь в Arduino. Читать далее Read more

21

Habr
AI_Foxmaster @ Habr 1 place · 01/03/2026 08:00 EDT

Искусственный интеллект… и Третья Мировая война

Не раз встречал мнение, что война - двигатель прогресса. Радар, реактивная авиация, компьютеры и медицина - продукты WW-II, а новые сплавы, спутниковая связь и интернет - тоже продукты войны, но уже холодной. Может ли война снова стать драйвером, только в области ИИ? Читать далее Read more

15

Habr
cognitronn (BotHub) @ Habr 1 place · 01/05/2026 00:44 EDT

На некоторые вопросы ответить проще, чем на другие.Много лет назад - больше, чем мне хотелось бы признать - в те времена, когда программное обеспечение устанавливалось с компакт-дисков, а для выхода в интернет нужно было ждать, пока модем дозвонится по телефонной линии, мы писали тексты с помощью текстовых процессоров.Именно так Microsoft Word получил свое название: буквально версия текстового процессора от Microsoft. А до Word были терминальные редакторы вроде WordStar - которым,... Read more

9

Habr
davidaganov @ Habr 2 place · 01/02/2026 10:55 EDT

Осознанный вайб-кодинг

Личный опыт использования ИИ в разработке: от пет-проектов до рабочих задач. Где вайб-кодинг действительно ускоряет работу, а где превращается в иллюзию скорости и потерю контроля над проектом. Читать далее Read more

8

Habr
dreammaster19 @ Habr 1 place · 01/03/2026 08:07 EDT

Установка и настройка llama.cpp с ROCm на Ubuntu 24.04 для AMD Radeon RX 7600 XT

Моя цель казалась простой: поставить Ubuntu 24.04 и запустить локальную нейросеть на своей новой Radeon RX 7600 XT. Реальность оказалась жестче.Делюсь полным чек-листом действий — от первого терминала после установки ОС до момента, когда Python-скрипт получает ответ от модели, думающей на вашем же железе. Если вы тоже верите в силу open-source и «красного» стека, вам сюда. Читать далее Read more

7

Habr
muxa_ru @ Habr 2 place · 01/07/2026 19:34 EDT

7 января — День Программиста! Какого?

История с тем, что украинский президент установил на 7 января «День программиста» слегка взбудоражила общественность, но не с той стороной, которую я считаю самой интересной.Вобщем, сперва будет рассказ о том, откуда берутся всякие там «Международные дни» и какова их ценность, а затем будет вопрос, на который я не смог найти ответа. Читать далее Read more

8

Habr
onlyahead @ Habr 1 place · 01/06/2026 03:20 EDT

Почему мы все хорошо живём и обязаны этим капитализму?

Как жадные до прибыли торгаши и спекулянты привели планету к прогрессу, и почему девайс с которого вы читаете эту статью заслуга капитализма. Об эпидемии чумы, Ост-Индской компании и ростовщиках с патентным правом. 1/3 статей из цикла истории Капитализма. Читать далее Read more

3

Habr
cognitronn (BotHub) @ Habr · 01/02/2026 05:12 EDT

[Перевод] Пузырь ИИ: крах, который изменит поколения

Оценка американского фондового рынка сегодня выше, чем перед крахом 1929 года. Что это значит для всех нас?Financial Times опубликовала материал, который вы, возможно, должны были видеть повсюду, но почему-то не видели.Оценка американского фондового рынка сегодня выше, чем была перед крахом Уолл-стрит в 1929 году.Просто осознайте это на секунду.Выше, чем в 1929-м. Выше, чем в 2008-м. На уровне пузыря доткомов.И это подтверждается не одним показателем, а сразу несколькими - коэффициентом «цена/прибыль»,... Read more

3

Habr
valisak (RUVDS.com) @ Habr 2 place · 01/04/2026 08:01 EDT

Проблема иерархии: почему гравитация (относительно) слабая, и почему это волнует физиков

Один из самых странных фактов о нашей Вселенной в то же время и один из самых известных: гравитация, как взаимодействие, невероятно слаба. Слаба не в том смысле, что она не формирует галактики и не удерживает планеты на орбите — она это очевидно делает — но слаба по сравнению с другими фундаментальными силами природы. Это огромное несоответствие лежит в основе того, что физики называют «проблемой иерархии», одной из самых глубоких и... Read more

3

Most popular sources

  • You see 843 news out of 843.
  • Sources 61 out of 61.
Wired 18% 15
Business Insider 14% 4
The Verge 13% 0
Gizmodo 7% 0
CNET 7% 2
View sources »

LIKE us on Facebook so you won't miss the most important news of the day!

09.01.2026 01:58
Last update: 01:50 EDT.
News rating updated: 08:50.

What is Times42?

Times42 brings you the most popular news from tech news portals in real-time chart.
Read about us in FAQ section.


Times42 © 2026