Функция dir() - удобна для получения списка атрибутов у любого объекта.
Ранее я писал про функцию __dir__() в модуле (не путайте её с переменной __all__(), которая указывает список объектов для импорта если встречается конструкция from module import *).
Скорее всего вы уже знаете как использовать функцию dir(). Любой объект может реализовать метод __dir__() чтобы указать список имеющийхся и динамических атрибутов. И функция dir() поможет получить список этих атрибутов.
>>> dir(str)
['__add__', '__class__', '__contains__', ...]
У этой функции есть еще один способ применения. Её можно вызвать без аргумента, и в таком случае она вернёт список имён в текущем неймспейсе.
>>> dir()
['__builtins__', '__doc__', '__file__', ...]
>>> def test():
>>> x = 1
>>> print(dir())
>>> test()
['x']
#basic#tricks
CRPF QRT teams have taken over Security of Nabanna & other Key Govt HQs in West Bengal amid the power transition and have sealed all movements of Government Files, orders from Union Home Ministry
#Policy
West Bengal Chief Secretary orders all Department Secretaries and Head of Offices to ensure that no important paper or file is removed or damaged or taken out from the offices. #Policy
🚨 Indian Govt invokes Force Majeure for contracts hit by West Asia disruptions
👉🏻 West Asia situation treated as war-like event for contracts
👉🏻 Contractors can claim relief for delays linked to disruptions
👉🏻 Govt may grant 2–4 month extension case-by-case
👉🏻 No penalties or liquidated damages for eligible delays
👉🏻 Applies across goods, services & works contracts
👉🏻 Valid only if no prior default before 27 Feb 2026
👉🏻 Contracts delayed beyond 90 days may be terminated without penalty #Policy