Dataclasses, contextvars and importlib.ressources were introduced with Python 3.6.
https://docs.python.org/3/whatsnew/3.8.html- Assignment expressions
- Positional-only parameters
- Parallel filesystem cache for compiled bytecode files
- Debug build uses the same ABI as release build
- f-strings support = for self-documenting expressions and debugging
- PEP 578: Python Runtime Audit Hooks
- PEP 587: Python Initialization Configuration
- Vectorcall: a fast calling protocol for CPython
- Pickle protocol 5 with out-of-band data buffers
I guess the PEP587 could be very interesting for this project.
What I really like is the ongoing improvement of the math module:
https://docs.python.org/3/whatsnew/3.8.html#mathhttps://docs.python.org/3/whatsnew/3.7.html#mathhttps://docs.python.org/3/whatsnew/3.6.html#mathhttps://docs.python.org/3/whatsnew/3.5.html#mathTo calculate distances, we've used often constructs like this:
Code: Select all
def calc_dist1(x1,y1,z1, x2, y2, z2):
return math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2 + (z2 - z1) ** 2)
The function math.hypot took only 2 arguments. Since Python 3.8 you can have as many arguments as you want, so you can also calculate multidimensional distances. Previous there was a funny change: Allow functions to take more as 255 arguments.
Code: Select all
def calc_dist2(x1,y1,z1, x2, y2, z2):
return math.hypot(x2 - x1, (y2 - y1), (z2 - z1))
But wait, they added also math.dist(p, q)
Code: Select all
def calc_dist3(x1,y1,z1, x2, y2, z2):
return math.dist((x1, y1, z1), (x2, y2, z2))
The point is, if you have the possibility to use a newer version of the language, you should do it.
This can, if adapted, improve existing code. Making it more readable and gaining more performance.
I still not using your plugin, because I stopped hosting game servers, but I like to see a Project which supports modern Python.
The examples above is just a small area. I wish I had this functions in the Software I'm working with, but they use Stackless Python 2.7.
Mostly all features I like, are not supported there. This sucks really and we have paid much money for the licenses (Visual Components).
It sucks so much, that I'm thinking to use Blender for simulation. Hopefully the last change saves me to write Code :-D