Page 1 of 1

Sourcepython python support

Posted: Tue Apr 02, 2019 5:45 pm
by velocity
Just to be sure, is source python using Python 3.6.1?

Re: Sourcepython python support

Posted: Tue Apr 02, 2019 7:21 pm
by Ayuto
Yes, you can see that if you start your server with +developer 1 or if you look at the wiki. Of course, the wiki could be outdated, but +developer 1 will always show the correct version. It will print something like this during start up:

Code: Select all

[Source.Python] Python version 3.6.1 (default, Jun  4 2017, 19:53:11) [MSC v.1900 32 bit (Intel)] initialized!

Re: Sourcepython python support

Posted: Sat Apr 06, 2019 4:51 pm
by DeaD_EyE
Are there plans to switch to Python 3.7.3?

Re: Sourcepython python support

Posted: Sat Apr 06, 2019 6:57 pm
by Ayuto
That will certainly happen someday, but there is no ETA. Is there a feature you would like to use from Python 3.7 or did you ask just out of curiosity?

Re: Sourcepython python support

Posted: Sat Apr 06, 2019 11:34 pm
by velocity
I don't recommend switching to 3.7 anytime soon, probably 80% of pythons library won't work in 3.7 if I'm wrong, then np, but I'm pretty sure they are going to be compatibility issues with a lot of py libs.

It shouldn't be updated before the "python community" catches up.

Re: Sourcepython python support

Posted: Sun Apr 07, 2019 1:44 am
by L'In20Cible
velocity wrote:I don't recommend switching to 3.7 anytime soon, probably 80% of pythons library won't work in 3.7 if I'm wrong, then np, but I'm pretty sure they are going to be compatibility issues with a lot of py libs.

It shouldn't be updated before the "python community" catches up.

There wasn't any major API changes in that version; mainly bug fixes and new features. Python updates are also usually designed to keep compatibility between versions if they are not major. For example, everything that works in 3.6 should works the same in 3.7 but everything that works in 3.x might not works the same in 4.x, etc. Anyways, a feature I'm using in another project and that I really like is the module __getattr__ and __dir__ function for dynamic types creation. Not necessarily useful for SP because by design we declare everything in the __all__ attribute but this is a very cool and useful feature.

Re: Sourcepython python support

Posted: Fri Apr 12, 2019 1:12 pm
by DeaD_EyE
There are some internal improvements for speed. All libraries I need, are working with Python 3.7 (web/scientific stuff).
I guess TensorFlow is still not compatible, because of the async keyword. It's since Python 3.7 a keyword and can't used as a name.

But maybe you wait a little bit longer until Python 3.8 has been released, then we get a new syntax:

Re: Sourcepython python support

Posted: Fri Apr 12, 2019 3:47 pm
by Ayuto
We need to make sure 3.7 or 3.8 doesn't require a higher GLIBC version. Otherwise SP wouldn't run anymore on servers with GLIBC <= 2.17. We already had that problem in the past, because many game servers are running on old systems and the hosters don't update them.