Подразумеваемые неймспейсы или неявные пакеты.
Этот функционал добавлен в Python 3.3
Что он означает?
Ранее, до 3.3 пакетами считались лишь директории, в которых есть файл __init__.py.
Этот файл одновременно являлся свидетельством того, что директория это Python-пакет, и служил "телом" этого пакета. То есть местом, где можно написать код, как это делается внутри модуля. Этот код исполняется в момент импорта пакета, так что его принято называть "код инициализации пакета".
Начиная с версии 3.3 Любая директория считается пакетом и Python будет пытаться использовать любую директорию для импорта.
Конечно, не любую в файловой системе, а только те что находятся в sys.path.
Это значит, что теперь __init__.py нужно делать только если:
🔸 вам требуется создать код инициализации пакета
🔸 нужна совместимость со старыми версиями Python
На мой взгляд это немного упрощает разработку, делает её чище, но с другой стороны убивает некоторую однозначность происходящего.
Например, я создал репозиторий со своей библиотекой и рядом положил код примеров или тестов.
repo_name/
my_library/
__init__.py
main.py
examples/
exam1.py
exam2.py
В этом репозитории пакетом является только my_library, остальные директории это не пакеты, это просто дополнительный код в файлах. Директория examples не добавлена в sys.path, в ней нет рабочих модулей. Но если она лежит рядом с my_library, то Python вполне сможет импортнуть из неё модули, так как посчитает что examples это валидный пакет.
Конечно, пример несколько надуманный. Никто не будет добавлять корень репозитория в sys.path. Но, я думаю, суть ясна. Иногда директория это просто директория а не пакет!
#basic#pep
#myth
Chetga chiqsang, ba’zi stereotiplar parchalanadi deydiku. Ha afsus koʻpchiligi haqiqat boʻlib chiqadi.
Masalan, Uzbekistanni Pakistan deb oʻylash.
Bu mif emas, men bilan bir necha marta boʻldi. Nafaqat studentlar, balki teacher koʻpchiligi bilmaydiyam bizni mavjudligimizni.
On dragons
The dragon Smej Gorynytsch was terrorizing the region around Kiev during the 11th century.
The hero Dobrynja vanquished the dragon ultimately.
This story follows the same pattern as Zeus defeating Typhon or Perun destroying Veles.
#dragon#myth
@EuropeanTribalism
#StudentsQuestionsAnswered#myth
Let's debunk one common myth surrounding the word count in IELTS Writing: writing more / fewer words than necessary will lower your score.
In the past, there was a fixed penalty for writing fewer words than required, as per instructions. But IELTS abolished that as of 2018, and you will not lose marks for being under word. It is also evident that there is no such thing as an upper limit in IELTS Writing. However, there is still a debate over whether or not going way over the recommended number affects your score.
Now, does writing 200-220 words for Task 2 universally mean you will lose marks? NO! It's not the number of words that would lower your score, it is what is associated with it: main ideas that lack development. Clearly, your main ideas need to be developed sufficiently, warranting relevant reason(s), explanation(s), and example(s). This means that you would need at least 5 sentences to write a decent body paragraph, which would probably contain 10-20 words each — if you do the math, you would need to write at least 250 words no matter what! This goes to show that if you were to actually write fewer words than required, your ideas would be left under-developed (Task Response: Band 5-6 as per the band descriptors), which means that it's not being underlength per se that would impact your score — it is its result that does so.
However, it's also a matter of the task at hand — whether or not it calls for a lot of words. There are certain questions that you could fully respond to with only 250-270 words, while there are also some that require far more words than necessary, say 500 words. In this case, it is perfectly fine to produce what you might assume is an overly long essay, as slashing this word count could compromise your TR score — you would not be able to fully cover the topic. So think twice before you pounce on my 400-word long essays.
There is also an issue of 'redundancy' — writing too many words than necessary language-wise — that ticks off many IELTS Instructors such as myself. I check dozens of essays every week only to find out that most of the words and sentences in them are simply unnecessary. In an attempt to impress the reader, students go out their way to use seemingly high-level words/phrases such as 'due to the fact that' instead of a simple 'because'. I completely disapprove of this practice and argue that efficiency and communication should be prioritized in any type of writing — you should treat your words as if you treat your money. Thus, especially at lower levels (Band 5-6), candidates are highly recommended to keep the word count hovering at 250-300 words.
Finally, let me also shed some light on Task 1, which is the part of Writing that doesn't receive the level of attention it deserves. When summarizing a chart/diagram, it is important to understand that there are usually a lot of key features you need to highlight and report. If you want to pull off Task 1, you should cover all those key features fully and clearly (Task Achievement: Band 8). Missing even one of such features would set you up for failure: Task Achievement: Band 4. As such, you might want to care less about how many words you need to write and more about what actually matters. I, for one, never think about the number of words when writing something; I focus on the message — so should you!
@ieltsulugbeks
🎬 "Cinema is one of the last remaining places that transports us from the realm of the mundane into the numinous."
John Bucher
Mythblast
2025
#josephcampbell
#cinema
#myth
AETATESOLIS