Re: [RELEASE] Python 3.13.1, 3.12.8, 3.11.11, 3.10.16 and 3.9.21 are now available

2024-12-03 Thread Jason Friedman via Python-list
🙏 On Tue, Dec 3, 2024 at 5:06 PM Thomas Wouters via Python-list < python-list@python.org> wrote: > Another big release day! Python 3.13.1 and 3.12.8 were regularly scheduled > releases, but they do contain a few security fixes. That makes it a nice > time to release the security-fix-only versions

[RELEASE] Python 3.13.1, 3.12.8, 3.11.11, 3.10.16 and 3.9.21 are now available

2024-12-03 Thread Thomas Wouters via Python-list
Another big release day! Python 3.13.1 and 3.12.8 were regularly scheduled releases, but they do contain a few security fixes. That makes it a nice time to release the security-fix-only versions too, so everything is as secure as we can make it.

Re: super().__init__() and bytes

2024-12-03 Thread Greg Ewing via Python-list
On 4/12/24 3:24 am, Roel Schroeven wrote: It's not entirely clear to me though how bytes.__new__ *can* set an object's value. Isn't __new__ also a regular function? Yes, but the __new__ methods of the builtin immutable objects (int, str, bytes, etc.) are implemented in C, and so are able to do

Re: Cheetah 3.4.0

2024-12-03 Thread Mohammadreza Saveji via Python-list
Thanks a lot Oleg sincerely yours On Mon, Dec 2, 2024 at 5:27 PM Oleg Broytman via Python-list < python-list@python.org> wrote: > Hello! > > I'm pleased to announce version 3.4.0, the final release > of branch 3.4 of CheetahTemplate3. > > > What's new in CheetahTemplate3 > ===

Re: super().__init__() and bytes

2024-12-03 Thread Roel Schroeven via Python-list
Op 3/12/2024 om 13:55 schreef Anders Munch via Python-list: Roel Schroeven wrote: > As a follow-up, it looks like this behavior is because bytes and int are immutable. Yes. OK. > But that doesn't tell me why using super().__init__() doesn't work for immutable classes. bytes.__init__ does w

RE: super().__init__() and bytes

2024-12-03 Thread Anders Munch via Python-list
Roel Schroeven wrote: > As a follow-up, it looks like this behavior is because bytes and int are > immutable. Yes. > But that doesn't tell me why using super().__init__() > doesn't work for immutable classes. bytes.__init__ does work, but it's just an inherited object.__init__, which does no

Re: super().__init__() and bytes

2024-12-03 Thread Roel Schroeven via Python-list
Op 3/12/2024 om 10:41 schreef Roel Schroeven via Python-list: [...] When I try the same with bytes as base class though, that doesn't work (at least in the Python version I'm using, which is CPython 3.11.2 64-bit on Windows 10): class MyBytes(bytes):     def __init__(self, data):     supe

super().__init__() and bytes

2024-12-03 Thread Roel Schroeven via Python-list
We can use super().__init__() in the __init__() method of a derived class to initialize its base class. For example: import string class MyTemplate(string.Template):     def __init__(self, template_string):     super().__init__(template_string) print(MyTemplate('Hello ${name}').substitute(na