Загрузка...

Python dict.fromkeys gives everyone the same list #pythonweirdestlogic

Using dict.fromkeys with a mutable default creates a dictionary where every key points to the exact same list object. Adding 'admin' to Alice gives Bob and Carol admin too. The list is created once and shared, not copied for each key.

Видео Python dict.fromkeys gives everyone the same list #pythonweirdestlogic канала Python Peak
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять