Telegram Group & Telegram Channel
Определение литеральных типов

Когда нам может понадобится определить из полученной строки литеральный тип (строки, числа, списки, кортежи, словари, логические значения и None), мы можем воспользоваться функцией literal_eval() из модуля ast.

Данная функция поможет безопасно определить литеральный тип, а в случае если был передан не литерал, то выбросит исключение. Это можно использовать для оценки выражений из внешних источников при парсинге файлов, либо пользовательского ввода.

#ast #literal_eval



tg-me.com/python_academy/1928
Create:
Last Update:

Определение литеральных типов

Когда нам может понадобится определить из полученной строки литеральный тип (строки, числа, списки, кортежи, словари, логические значения и None), мы можем воспользоваться функцией literal_eval() из модуля ast.

Данная функция поможет безопасно определить литеральный тип, а в случае если был передан не литерал, то выбросит исключение. Это можно использовать для оценки выражений из внешних источников при парсинге файлов, либо пользовательского ввода.

#ast #literal_eval

BY Python Academy




Share with your friend now:
tg-me.com/python_academy/1928

View MORE
Open in Telegram


Python Academy Telegram | DID YOU KNOW?

Date: |

Telegram announces Search Filters

With the help of the Search Filters option, users can now filter search results by type. They can do that by using the new tabs: Media, Links, Files and others. Searches can be done based on the particular time period like by typing in the date or even “Yesterday”. If users type in the name of a person, group, channel or bot, an extra filter will be applied to the searches.

Telegram Gives Up On Crypto Blockchain Project

Durov said on his Telegram channel today that the two and a half year blockchain and crypto project has been put to sleep. Ironically, after leaving Russia because the government wanted his encryption keys to his social media firm, Durov’s cryptocurrency idea lost steam because of a U.S. court. “The technology we created allowed for an open, free, decentralized exchange of value and ideas. TON had the potential to revolutionize how people store and transfer funds and information,” he wrote on his channel. “Unfortunately, a U.S. court stopped TON from happening.”

Python Academy from us


Telegram Python Academy
FROM USA