[Python-ideas] warning when importing a file from directoty

2021-02-07 Thread Jonatan
I see many people who have their project something like this: ``` directory/ some_module.py main.py ``` and in main.py they do ``` from some_module import some_function ``` while they have a library named `some_module` that is installed from pip, and they can't figure out why Python sa

[Python-ideas] Re: warning when importing a file from directoty

2021-02-09 Thread Jonatan
Someone? ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/pyth

[Python-ideas] A better math.factorial

2021-09-16 Thread Jonatan
Currently, math.factorial only supports integers and not floats, whereas the "mathematical" version supports both integers and floats. I.e: ``` import math def better_factorial(n): return n * math.gamma(n) print(math.factorial(10) == better_factorial(10)) ``` This ends up in `True`, as tha

[Python-ideas] A new suggestion for Python

2020-09-30 Thread Jonatan
Hi, My name is Jonatan and i am programming in Python for about 4 years, I have a great idea, there are iX` methods, such as __ior__, __iadd__, __iand__ etc.., which implements the |=, +=, &= behavior, it would be nice if you could implement also __igetattr__ or something, which means: instea

[Python-ideas] super() magic-methods.

2020-11-22 Thread Jonatan
nted twice. somehow, The expression "super() other" does not turn into "super().__OPERATOR__(other)". this bug is for any operator that you apply on super(). I'd be happy to hear from you why it happens and whether will it be fixe

[Python-ideas] Make for/while loops nameable.

2020-12-03 Thread Jonatan
Hi, sometimes I do nested loops and I want to break specific loop, outer/inner etc. I need to do an ugly thing with for..else and it's annoying. It'd be nice if we could do so: for i in range(10) as loop_i: for j in range(i, i + 10) as loop_j: if i + j == 9: break loop_i o