Просмотр исходного кода

updated doc comment for deprecations utility

Rafał Pitoń 8 лет назад
Родитель
Сommit
b49ad62bea
1 измененных файлов с 17 добавлено и 0 удалено
  1. 17 0
      misago/core/deprecations.py

+ 17 - 0
misago/core/deprecations.py

@@ -1,3 +1,20 @@
+"""
+Utility module useful for refactors,
+
+Defines utility function for easy raising of warnings in deprecated functions.
+
+This function is set to use stacklevel 3 as default making following code in test.py:
+
+def depreacted_function():
+    warn("This function is deprecated")
+
+
+def other_function():
+    deprecated_function()
+
+
+Will raise warning about 1st line in other_function calling deprecated function.
+"""
 import warnings