[RELEASE] Python 3.12.5 released

2024-08-07 Thread Thomas Wouters via Python-list
Python 3.12.5 is now available:

https://www.python.org/downloads/release/python-3125/

This is the fifth maintenance release of Python 3.12

Python 3.12 is the newest major release of the Python programming language,
and it contains many new features and optimizations. 3.12.5 is the latest
maintenance release, containing more than 250 bugfixes, build improvements
and documentation changes since 3.12.4.

This version of Python 3.12 also comes with pip 24.2 by default. *However,
due to an incompatibility with older macOS versions, macOS 10.9 through
10.12 will downgrade their version of pip to 24.1.2 during the installation
process* (in the Install Certificates step). See the installer ReadMe and the
pip issue on the matter  for more
information. Versions of macOS older than 10.13 haven’t been supported by
Apple since 2019, and maintaining support for them is becoming increasingly
difficult. While this release of 3.12 still supports them, *it is likely
that we will be forced to drop support for macOS 10.12 and older in a
future 3.12 release*. (Python 3.13 has already dropped support for them.)
Major
new features of the 3.12 series, compared to 3.11
New
features

   - More flexible f-string parsing
   
,
   allowing many things previously disallowed (PEP 701
   ).
   - Support for the buffer protocol
   

   in Python code (PEP 688 ).
   - A new debugging/profiling API
   

   (PEP 669 ).
   - Support for isolated subinterpreters
   

   with separate Global Interpreter Locks (PEP 684
   ).
   - Even more improved error messages
   .
   More exceptions potentially caused by typos now make suggestions to the
   user.
   - Support for the Linux perf profiler
    to report
   Python function names in traces.
   - Many large and small performance improvements
    (like PEP
   709  and support for the BOLT binary
   optimizer), delivering an estimated 5% overall performance improvement.

Type
annotations

   - New type annotation syntax
   

   for generic classes (PEP 695 ).
   - New override decorator
   

   for methods (PEP 698 ).


Deprecations

   - The deprecated wstr and wstr_length members of the C implementation of
   unicode objects were removed, per PEP 623
   .
   - In the unittest module, a number of long deprecated methods and
   classes were removed. (They had been deprecated since Python 3.1 or 3.2).
   - The deprecated smtpd and distutils modules have been removed (see PEP
   594  and PEP 632
   . The setuptools package continues to
   provide the distutils module.
   - A number of other old, broken and deprecated functions, classes and
   methods  have
   been removed.
   - Invalid backslash escape sequences in strings now warn with
   SyntaxWarning instead of DeprecationWarning, making them more visible.
   (They will become syntax errors in the future.)
   - The internal representation of integers has changed in preparation for
   performance enhancements. (This should not affect most users as it is an
   internal detail, but it may cause problems for Cython-generated code.)

For more details on the changes to Python 3.12, see What’s new in Python
3.12 .
More
resources

   - Online Documentation .
   - PEP 693 , the Python 3.12
   Releas

python3 package import difference?

2024-08-07 Thread Tobiah via Python-list

I have an old library from 20 some years ago
for use with python2, that is structured like this:

rcs
├── dbi
│   ├── __init__.py
│   ├── dbi.py
│   └── regos.py
└── __init__.py  --   *empty*


the __init__.py file under 'rcs' is empty.
The one under rcs.dbi contains:

from dbi import *
from regos import *


With python2, I'd go:

import rcs.dbi

then I'd have access to stuff in regos.py
as:

rcs.dbi.feature()  (Where 'feature' is defined in regos.py)


When I do the same import with python3, I get:

Traceback (most recent call last):
  File "/home/toby/me", line 1, in 
import rcs.dbi
  File "/usr/regos-1.0/lib/python/rcs/dbi/__init__.py", line 1, in 
from dbi import *
ModuleNotFoundError: No module named 'dbi'


What's changed, and how do I fix it?


Thanks!
--
https://mail.python.org/mailman/listinfo/python-list


Re: python3 package import difference?

2024-08-07 Thread Ronaldo Sc via Python-list
I believe you will need to track the modules in the folder  *dbi  *in the
root file '__init__.py'.

So there's an alternative to use the statement __all__ in the root filet
__init__.py, check the link where I find a use case:

*https://sentry.io/answers/what-is-init-py-for-in-python/#using-__init__py-to-run-code-and-control--imports
*


References to take more deep in those issues:
PEP-3147 
https://docs.python.org/3/tutorial/modules.html

 in this link above we have some examples of relative imports:
from . import echo
from .. import formats
from ..filters import equalizer


In your code you're using "import *" , this is not a good practice when
using only some features in your module(s) because you'll inject more
garbage into memory if there are features you're not using.

Share with us the updates on your code.

Ronaldo

Em qua., 7 de ago. de 2024 às 14:40, Tobiah via Python-list <
python-list@python.org> escreveu:

> I have an old library from 20 some years ago
> for use with python2, that is structured like this:
>
>  rcs
>  ├── dbi
>  │   ├── __init__.py
>  │   ├── dbi.py
>  │   └── regos.py
>  └── __init__.py  --   *empty*
>
>
> the __init__.py file under 'rcs' is empty.
> The one under rcs.dbi contains:
>
>  from dbi import *
>  from regos import *
>
>
> With python2, I'd go:
>
>  import rcs.dbi
>
> then I'd have access to stuff in regos.py
> as:
>
>  rcs.dbi.feature()  (Where 'feature' is defined in regos.py)
>
>
> When I do the same import with python3, I get:
>
>  Traceback (most recent call last):
>File "/home/toby/me", line 1, in 
>  import rcs.dbi
>File "/usr/regos-1.0/lib/python/rcs/dbi/__init__.py", line 1, in
> 
>  from dbi import *
>  ModuleNotFoundError: No module named 'dbi'
>
>
> What's changed, and how do I fix it?
>
>
> Thanks!
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python3 package import difference?

2024-08-07 Thread Chris Angelico via Python-list
On Thu, 8 Aug 2024 at 03:40, Tobiah via Python-list
 wrote:
> The one under rcs.dbi contains:
>
>  from dbi import *
>  from regos import *
>

You probably want these to be package-relative now:

from .dbi import *
from .regos import *

Or, since you're using namespaced imports anyway ("rcs.dbi.feature"),
you may prefer this form:

from . import dbi, regos

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


magic-wormhole 0.15.0

2024-08-07 Thread meejah via Python-list
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512


Greetings,

I'm gruntled to announce that magic-wormhole 0.15.0 is released.

Magic Wormhole is a Python library and CLI tool to securely get
arbitrary data from one computer to another using short, one-time,
human- pronouncable codes and end-to-end encryption.

The library allows use of the lower-level protocol for things besides
file-transfer.

In this release are the following changes since 0.14.0:

* Incorporate attrs' zope-interface support (#492, #527, from 
https://github.com/meejah)
* Add "codespell" to correct spelling (#526, from https://github.com/yarikoptic)
* Fix bash completions (#525, from https://github.com/RobertoD91)
* run tests properly when Noise is not installed (#522, from 
https://github.com/anarcat)

You can find the release on PyPI:

   https://pypi.org/project/magic-wormhole/

More information can be found:

   https://magic-wormhole.readthedocs.io/en/latest/welcome.html
   https://github.com/magic-wormhole/magic-wormhole


thanks,

meejah


-BEGIN PGP SIGNATURE-

iQFFBAEBCgAvFiEEnVor1WiOy4id680/wmAoAxKAaacFAma0DBkRHG1lZWphaEBt
ZWVqYWguY2EACgkQwmAoAxKAaad3QwgAg9XFz+xO7Xl67lflWX/JRr63SCJ39frL
BejL6AX1sdcLKUoqvX/WUMjTsAzoNrOMtmPbgXM1BIwIkY/8racV6H8fgBbeyrOq
3CW2kLVhfsGCdf961kF0/r2ToXBTB7/tkSvsmmR3W/IIkaT8+V2/w5aROBcreLq/
8r1KCOpPFqG6K873ohoOQNETz7gPIwWqfnET7qyRulToauxNc9e9hbYjXacLSVwl
CnkE7HsrDsbG2NEekJiwKyXJ59I18UZUj5S7V3ul5Q11BcsE7hftIwbzsr7VvRmi
VXuQVgJ28iezyBgYQ6A/JWTQocCtbuQ+c6DEd+CdFNdzJy6Oofo8DQ==
=A0jS
-END PGP SIGNATURE-
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python3 package import difference?

2024-08-07 Thread Cameron Simpson via Python-list

On 07Aug2024 08:35, Tobiah  wrote:

When I do the same import with python3, I get:

   Traceback (most recent call last):
 File "/home/toby/me", line 1, in 
   import rcs.dbi
 File "/usr/regos-1.0/lib/python/rcs/dbi/__init__.py", line 1, in 
   from dbi import *
   ModuleNotFoundError: No module named 'dbi'


Python 3 imports are absolute (they start from the top of the package 
tree and you have no `dbi` at the top). You want a relative import i.e.:


from .dbi import *

Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list