تو پایتون گاهی امکان داره که یه سری محاسبات تکراری با استفاده از یک تابع انجام بشه. برای جلوگیری از محاسبات تکراری و استفاده از جوابهایی که قبلا تولید شدند، پایتون اومده یه decorator معرفی کرده به نام lru_cache.
این امکان میتونه مثلا تو افزایش سرعت اجرای کدهاتون خیلی کاربردی باشه و اینکه میشه براش مقدار حافظه هم تعیین کرد که یه موقع stackتون overflow نشه!
تو این لینک به جزییات این decorator خوب اشاره شده، توصیه میکنم 5 دقیقه وقت بذارید و بخونیدش.
تو پایتون گاهی امکان داره که یه سری محاسبات تکراری با استفاده از یک تابع انجام بشه. برای جلوگیری از محاسبات تکراری و استفاده از جوابهایی که قبلا تولید شدند، پایتون اومده یه decorator معرفی کرده به نام lru_cache.
این امکان میتونه مثلا تو افزایش سرعت اجرای کدهاتون خیلی کاربردی باشه و اینکه میشه براش مقدار حافظه هم تعیین کرد که یه موقع stackتون overflow نشه!
تو این لینک به جزییات این decorator خوب اشاره شده، توصیه میکنم 5 دقیقه وقت بذارید و بخونیدش.
A Telegram spokesman declined to comment on the bond issue or the amount of the debt the company has due. The spokesman said Telegram’s equipment and bandwidth costs are growing because it has consistently posted more than 40% year-to-year growth in users.
Telegram Auto-Delete Messages in Any Chat
Some messages aren’t supposed to last forever. There are some Telegram groups and conversations where it’s best if messages are automatically deleted in a day or a week. Here’s how to auto-delete messages in any Telegram chat. You can enable the auto-delete feature on a per-chat basis. It works for both one-on-one conversations and group chats. Previously, you needed to use the Secret Chat feature to automatically delete messages after a set time. At the time of writing, you can choose to automatically delete messages after a day or a week. Telegram starts the timer once they are sent, not after they are read. This won’t affect the messages that were sent before enabling the feature.