[issue37295] Possible optimizations for math.comb()

2021-12-21 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy:  -pablogsal

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46147] Support AddressSanitizer in Windows build

2021-12-21 Thread anthony shaw


anthony shaw  added the comment:

After some experimentation, this can be done if you enable ASAN in all projects 
except python3dll.vcxproj

I think it would make sense (if this were supported) to have a flag in 
build.bat like there is for pgo

`build.bat --asan`

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46106] OpenSSL 1.1.1m is now available

2021-12-21 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the PR, Kumar!  Merged, with a few minor changes, to main (for 
3.11.0a4), 3.10 (3.10.2), and 3.9 (3.9.10).

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46106] OpenSSL 1.1.1m is now available

2021-12-21 Thread Ned Deily


Ned Deily  added the comment:


New changeset 5c4d11fe755a7adeaee6b838bc8faceadc29ed7d by Ned Deily in branch 
'3.9':
bpo-46106: Update OpenSSL to 1.1.1m (GH-30211) (GH-30225)
https://github.com/python/cpython/commit/5c4d11fe755a7adeaee6b838bc8faceadc29ed7d


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46106] OpenSSL 1.1.1m is now available

2021-12-21 Thread Ned Deily


Ned Deily  added the comment:


New changeset cf96c279ac960f2a5025e2ac887f9b932a4f1474 by Ned Deily in branch 
'3.10':
bpo-46106: Update OpenSSL to 1.1.1m (GH-30211) (GH-30224)
https://github.com/python/cpython/commit/cf96c279ac960f2a5025e2ac887f9b932a4f1474


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Call julia from Python: which package?

2021-12-21 Thread Dan Stromberg
Last I heard, Pypy itself will remain written in a statically typed dialect
of Python that is closest to Python 2.7.  However, what's written in that
language includes JIT-compiled interpreters for both Python 2.x and Python
3.x.

On Tue, Dec 21, 2021 at 9:15 AM Albert-Jan Roskam 
wrote:

>Hi all,
>Thank you very much for your valuable replies! I will definitely do some
>tracing to see where the bottlenecks really are. It's good to know that
>pypy is still alive and kicking, I thought it was stuck in py2.7. I will
>also write a mini program during the holiday to see how this
> Julia/Python
>interaction might work. The little bit of experience with Julia more or
>less coincides with what Oscar mentioned: a lot of "warm up" time. This
> is
>actually a py2.7 project that I inherited. I was asked to convert it to
>py3.8.
>Thanks and merry xmas!
>Albert-Jan
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue37295] Possible optimizations for math.comb()

2021-12-21 Thread Tim Peters


Tim Peters  added the comment:

I see no use of 128-bit ints in the CPython core. Advice: forget it. 

int64_t and uint64_t are required by C99, and are used many places in the core. 
Advice: use freely.

Note that if tables of "odd part mod 2**64" and "number of trailing zeroes" are 
used up through 67, then factorials up through 25! are trivially computed via

Fodd[i] << Fntz[i]


(at 26, the odd part no longer fits in 64 bits)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: print('\N{flag: Mauritius}') not supported in py3.9

2021-12-21 Thread boB Stepp

On 21/12/22 12:14PM, Python wrote:

On 30/11/2021 12.31, Cameron Simpson wrote:

On 30Nov2021 10:59, DL Neil  wrote:

...


I've nominated Kitty as
Fedora's default terminal. We'll see how it goes with work-loads beyond
raising the flag...


I'd like to hear how that goes down the track. If I find myself on a
Linux desktop again a good terminal emulator would be very welcome.



(given that @A-R has brought this thread back-to-life)


I have been surprised/shocked/horrified/annoyed to discover that the
(Linux) clipboard is not accessible from "Kitty".


Huh?  I use kitty and copy to and from the clipboard all the time.
1) ctrl+shift+c Copy to clipboard
2) ctrl+shift+v Paste from the clipboard
3) Using mouse to select text automatically copies it to the primary 
clipboard.
4) Middle-click of mouse to paste from the primary clipboard.


--
Wishing you only the best,
boB Stepp

Speeches are like steer horns -- a point here, a point there and a lot of bull
in between.
-- E. Anderson
--
https://mail.python.org/mailman/listinfo/python-list


[issue41222] POpen bufsize=0 ignored with universal_newlines=True

2021-12-21 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
nosy: +gregory.p.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46106] OpenSSL 1.1.1m is now available

2021-12-21 Thread Ned Deily


Change by Ned Deily :


--
pull_requests: +28448
pull_request: https://github.com/python/cpython/pull/30225

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46106] OpenSSL 1.1.1m is now available

2021-12-21 Thread Ned Deily


Change by Ned Deily :


--
pull_requests: +28447
pull_request: https://github.com/python/cpython/pull/30224

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46106] OpenSSL 1.1.1m is now available

2021-12-21 Thread Ned Deily


Ned Deily  added the comment:


New changeset fc54e722a2e66971f1a8e16cff24c844bf9c5ac4 by Kumar Aditya in 
branch 'main':
bpo-46106: Update OpenSSL to 1.1.1m (GH-30211)
https://github.com/python/cpython/commit/fc54e722a2e66971f1a8e16cff24c844bf9c5ac4


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46146] Python IDLE fails to start (tk font issue?)

2021-12-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

On a system where IDLE will not start, the code has to be run directly with 
'python3', however that is done there.  One will need to add the line 
'r.mainloop()' at the end of the script to see the tk window.  However, this is 
not needed to see the printed width results.

What tcl/tk version do you distribute?  Is the person seeing the bug using 
that?  Add "print(tk.call('info', 'patchlevel'))" to see.

I presume that when IDLE worked for you, you used the default font.  Specific 
tests to run:
python3 -m test -ugui test_tk test_tcl test_ttk_guionly test_ttk_textonly 
test_idle

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46146] Python IDLE fails to start (tk font issue?)

2021-12-21 Thread Matej Cepl


Matej Cepl  added the comment:

> Matej, what OS and font gives this error?  Please run the
> following, also uploaded, with the offending font, replacing the
> name I used.

I am a packager at SUSE maintaining Python packages both for
openSUSE and SLE (our commercial offering), even though
unfortunately cannot reproduce the issue myself. GUI programming is
just part of the Python libraries where I am really lost, so I filed
this bug (which was originally filed by somebody else at our
Bugzilla) here asking for help.

I will ask our reporter for testing your suggested reproducer.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46147] Support AddressSanitizer in Windows build

2021-12-21 Thread anthony shaw


New submission from anthony shaw :

I'd like to compile my C-extensions with ASAN for testing in Windows, but they 
cannot be loaded as the host python.exe process needs to be compiled with ASAN. 

https://docs.microsoft.com/en-us/cpp/sanitizers/asan?view=msvc-170#ide-msbuild

The EnableASAN flag would be a setting in vcxproj files within the PCBuild 
solution, and a flag in the build.bat to enable it.

--
components: Build, Windows
messages: 409006
nosy: anthonypjshaw, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Support AddressSanitizer in Windows build
type: enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46090] C extensions can't swap out live frames anymore

2021-12-21 Thread Brandt Bucher


Brandt Bucher  added the comment:

Fixing this actually ended up being a lot simpler than I anticipated (and it 
requires no changes on our end). All that's really required is saving and 
restoring:
- tstate->cframe->current_frame
- tstate->datastack_chunk
- tstate->datastack_top
- tstate->datastack_limit

You can see my proposed fix for Greenlet here (this PR also contains some other 
3.11-related fixes):

https://github.com/python-greenlet/greenlet/pull/280

There is one weird edge case in Greenlet's use that I don't *entirely* 
understand, where it sometimes needs to update a thread with a NULL frame (as 
discussed above). We need to replace the thread's datastack with *something* in 
this case: setting it to NULL crashes the interpreter when it tries to allocate 
frames later, but leaving it as-is puts us in a situation where two threads are 
sharing the same datastack (also a recipe for crashes). My solution is to set 
it to a statically allocated zero-size "dummy chunk" in this case. It seems to 
work fine, since the zero-size forces the interpreter to allocate a "real" 
chunk on the next frame push.

If this solution seems too hack-y, a very simple change on our end could be to 
start treating NULL as a valid datastack value, and have the thread state check 
for it when pushing new chunks. That would make for a relatively clean upgrade 
path for libraries like Greenlet, and doesn't require adding any new APIs.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46146] Python IDLE fails to start (tk font issue?)

2021-12-21 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

(This is behavior, not crash issue, as the latter is when there is no 
traceback.)

The editor code was added 3 years ago in #37929, PR-15452, to correct using the 
configured char width after font and window size changes make that invalid.  It 
is based on 
https://www.tcl.tk/man/tcl8.6/TkCmd/text.html#M21
"If the font does not have a uniform width then the width of the character “0” 
[zero] is used in translating from character units to screen units."  The 
implies that said char width is non-zero.  It would seem like a font bug if 
not.  This is first report I know of where width is 0.

The current code implements this as
   zero_char_width = \
Font(text, font=text.cget('font')).measure('0')

Matej, what OS and font gives this error?  Please run the following, also 
uploaded, with the offending font, replacing the name I used.

import tkinter as tk
from tkinter.font import Font
r = tk.Tk()
t = tk.Text(r, font=('Source Code Pro', 10, 'normal'))
t.pack()
s = '0oO !*}'
t.insert('1.0', s) # Only to check that all above is valid.
for c in s:
print(Font(t, font=t['font']).measure(c))

For fixed 10 pitch Source Code Pro, all widths are 8.
---

We could, of course, catch ZeroDivisionError, but when then?  This is why I 
want to know what OS, font, and a test with multiple characters.

On possibility is to check whenever font is set, but still, what then?

--
nosy: +taleinat
type: crash -> behavior
versions: +Python 3.11 -Python 3.8
Added file: https://bugs.python.org/file50507/tem.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46146] Python IDLE fails to start (tk font issue?)

2021-12-21 Thread Matej Cepl


New submission from Matej Cepl :

(originally filed as https://bugzilla.suse.com/1193409)

When trying to start "idle3.8", I get a ZeroDivisionError in
editor.py. Trying to patch it, I noticed that the complete UI of
IDLE shows no text. Since the same also happens with "idle3.9",
I guess it is a bug in tk.

The error happens also with a fresh user account.

The complete error message is as follows:

> idle3.8
Traceback (most recent call last):
  File "/usr/bin/idle3.8", line 5, in 
main()
  File "/usr/lib64/python3.8/idlelib/pyshell.py", line 1522, in main
shell = flist.open_shell()
  File "/usr/lib64/python3.8/idlelib/pyshell.py", line 329, in open_shell
self.pyshell = PyShell(self)
  File "/usr/lib64/python3.8/idlelib/pyshell.py", line 874, in __init__
OutputWindow.__init__(self, flist, None, None)
  File "/usr/lib64/python3.8/idlelib/outwin.py", line 79, in __init__
EditorWindow.__init__(self, *args)
  File "/usr/lib64/python3.8/idlelib/editor.py", line 218, in __init__
self.set_width()
  File "/usr/lib64/python3.8/idlelib/editor.py", line 366, in set_width
self.width = pixel_width // zero_char_width
ZeroDivisionError: integer division or modulo by zero
>

--
assignee: terry.reedy
components: IDLE
messages: 409003
nosy: mcepl, terry.reedy
priority: normal
severity: normal
status: open
title: Python IDLE fails to start (tk font issue?)
type: crash
versions: Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: print('\N{flag: Mauritius}') not supported in py3.9

2021-12-21 Thread dn via Python-list
On 30/11/2021 12.31, Cameron Simpson wrote:
> On 30Nov2021 10:59, DL Neil  wrote:
...

>> I've nominated Kitty as
>> Fedora's default terminal. We'll see how it goes with work-loads beyond
>> raising the flag...
> 
> I'd like to hear how that goes down the track. If I find myself on a 
> Linux desktop again a good terminal emulator would be very welcome.


(given that @A-R has brought this thread back-to-life)


I have been surprised/shocked/horrified/annoyed to discover that the
(Linux) clipboard is not accessible from "Kitty".

Go on, I dare you to remind me that good-old 'dumb-terminals' didn't
have 'clipboards'...
(neither did they have to cope with Unicode, emoticons, or national flags!)


Accordingly, having developed an idea in the REPL (running within
Kitty), could not later copy-paste into a Python module or tutorial text
(nor, next time the situation arises, to be able to illustrate an answer
to a question posted 'here').

Am somewhat in disbelief, and my fingers feel slightly singed. Grump!
(or its seasonal variation: "Grinch")


Am open to further non-terminal, terminal suggestions...

(during my post-op recovery period, am hoping to experiment with another
Linux distro (and Window Manager), which may alter the playing-field...)


Meantime, casting-off the terminal-Grinch, compliments of the season to
you...
-- 
Regards,
=dn
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue41210] Docs: More description(warning) about LZMA1 + BCJ with FORMAT_RAW

2021-12-21 Thread Ned Deily


Change by Ned Deily :


--
nosy:  -Smith129, kdrb, sakaranata

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41210] Docs: More description(warning) about LZMA1 + BCJ with FORMAT_RAW

2021-12-21 Thread Ned Deily


Change by Ned Deily :


--
Removed message: https://bugs.python.org/msg408995

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41210] Docs: More description(warning) about LZMA1 + BCJ with FORMAT_RAW

2021-12-21 Thread Ned Deily


Change by Ned Deily :


--
Removed message: https://bugs.python.org/msg408966

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41210] Docs: More description(warning) about LZMA1 + BCJ with FORMAT_RAW

2021-12-21 Thread Ned Deily


Change by Ned Deily :


--
Removed message: https://bugs.python.org/msg407902

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Py_TRASHCAN_SAFE_BEGIN/END in C extension?

2021-12-21 Thread Barry


> On 21 Dec 2021, at 22:08, Marco Sulla  wrote:
> 
> In Python 3.7, must Py_TRASHCAN_SAFE_BEGIN - Py_TRASHCAN_SAFE_END be
> used in a C extension?
> 
> I'm asking because in my C extension I use them in the deallocator
> without problems, but users signalled me that they segfault in Python
> 3.7 on Debian 10. I checked and this is true.

I searched the web for Py_TRASHCAN_SAFE_BEGIN
And that quickly lead me to this bug.

https://bugs.python.org/issue40608.

That gives lots of clues for what might be the problem.
It seems that is a deprecated api.

Barry

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


Py_TRASHCAN_SAFE_BEGIN/END in C extension?

2021-12-21 Thread Marco Sulla
In Python 3.7, must Py_TRASHCAN_SAFE_BEGIN - Py_TRASHCAN_SAFE_END be
used in a C extension?

I'm asking because in my C extension I use them in the deallocator
without problems, but users signalled me that they segfault in Python
3.7 on Debian 10. I checked and this is true.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PyCharm settings - per: print('\N{flag: Mauritius}') not supported in py3.9

2021-12-21 Thread Abdur-Rahmaan Janhangeer
Yet another unicode issue XD

Kind Regards,

Abdur-Rahmaan Janhangeer
about  | blog

github 
Mauritius
-- 
https://mail.python.org/mailman/listinfo/python-list


[Python-announce] Benchmark Smil vs Scikit-image (morphological features)

2021-12-21 Thread Jose-Marcio Martins da Cruz


Hello,

We've done a comparative benchmark (speed and memory usage) with Smil and 
Scikit-Image.

Smil is a mathematical morphology dedicated library of functions. So 
comparisons are done only on this area.

We've been working on Mathematical Morphology for more than 50 years now the discipline was created here at our research 
department in the sixties. Smil inherits the experience of previous libraries and software we've been writing since the 
70's.


In just some few words, Smil can be orders of magnitude faster than Scikit-image (hundreds or even thousands) on some 
operations thanks to parallelization and vectorization (SIMD), depending on the computer architecture.


Smil doesn't replace scikit-image but may be a good complement to scikit-image 
when speed is important.

Benchmark results are available at :
https://smil.cmm.minesparis.psl.eu/smil-vs-skimage

Comments are welcome,

Best regards

José-Marcio



--

 ---
 Jose Marcio MARTINS DA CRUZ, Ph.D.
 Ecole des Mines de Paris
 Centre de Morphologie Mathématique
 https://orcid.org/-0002-2981-7028
 ---
  Mon livre sur le spam : http://amzn.to/LEscRu
 ---

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


[issue37295] Possible optimizations for math.comb()

2021-12-21 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Am I correct in my understanding the 64 bits are always available, that 128 bit 
ints aren't universal, and that #ifdefs would be needed to extend the range of 
the table for systems that support it?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37295] Possible optimizations for math.comb()

2021-12-21 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

>  Finv = [pow(fodd, -1, 2**64) for fodd in Fodd]

This is a good trick.  I had already experimented with separating factorials 
into an odd component and a shift count, but failed to get a speed-up because 
the divisions were slow.  Having a table of multiplicative inverses and working 
mod 2**64 bypasses that problem nicely.  Division-free is the way to go :-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37295] Possible optimizations for math.comb()

2021-12-21 Thread Tim Peters


Tim Peters  added the comment:

Clever, Mark! Very nice.

The justification for the shift count isn't self-evident, and appears to me to 
be an instance of the generalization of Kummer's theorem to multinomial 
coefficients. I think it would be clearer at first sight to rely instead on 
that 2**i/(2**j * 2**k) = 2**(i-j-k), which is shallow.

So here's a minor rewrite doing that instead; it would add 68 bytes to the 
precomputed static data.

import math
# Largest n such that comb(n, k) fits in 64 bits for all k.
Nmax = 67

# Express n! % 2**64 as Fodd[n] << Fntz[n] where Fodd[n] is odd.
Fodd = [] # unsigned 8-byte ints
Fntz = [] # unsigned 1-byte ints
for i in range(Nmax + 1):
f = math.factorial(i)
lsb = f & -f # isolate least-significant 1 bit
Fntz.append(lsb.bit_length() - 1)
Fodd.append((f >> Fntz[-1]) % 2**64)

Finv = [pow(fodd, -1, 2**64) for fodd in Fodd]

# All of the above is meant to be precomputed; just static tables in C.

# Fast comb for small values.
def comb_small(n, k):
if not 0 <= k <= n <= Nmax:
raise ValueError("k or n out of range")
return ((Fodd[n] * Finv[k] * Finv[n-k] % 2**64)
<< (Fntz[n] - Fntz[k] - Fntz[n-k]))

# Exhaustive test
for n in range(Nmax+1):
for k in range(0, n+1):
assert comb_small(n, k) == math.comb(n, k)

Since 99.86% of comb() calls in real life are applied to a deck of cards ;-) , 
it's valuable that Nmax be >= 52.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46145] List reference not working properly

2021-12-21 Thread Antara


Antara  added the comment:

Not an issue

--
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46145] List reference not working properly

2021-12-21 Thread Antara


New submission from Antara :

o= [1,2,3,3]
print('o:',id(o))
d= o
print('d:',id(d))
d= [1,2,3,4]
dd= o
print('dd:',id(dd))
dd[3]= 5

print('o:',o)
print('d:',d)
print('dd:',dd)

===
Output:
o: 1976210449032
d: 1976210449032
dd: 1976210449032
o: [1, 2, 3, 5]
d: [1, 2, 3, 4]
dd: [1, 2, 3, 5]

Though o,d and dd points to the same memory pointer but d has different value. 
How can same memory location points to 2 different values?

--
messages: 408998
nosy: antarab
priority: normal
severity: normal
status: open
title: List reference not working properly
type: behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Call julia from Python: which package?

2021-12-21 Thread Albert-Jan Roskam
   Hi all,
   Thank you very much for your valuable replies! I will definitely do some
   tracing to see where the bottlenecks really are. It's good to know that
   pypy is still alive and kicking, I thought it was stuck in py2.7. I will
   also write a mini program during the holiday to see how this Julia/Python
   interaction might work. The little bit of experience with Julia more or
   less coincides with what Oscar mentioned: a lot of "warm up" time. This is
   actually a py2.7 project that I inherited. I was asked to convert it to
   py3.8.
   Thanks and merry xmas!
   Albert-Jan
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue46071] Graphlib documentation

2021-12-21 Thread David Mc Dougall


Change by David Mc Dougall :


--
pull_requests: +28446
pull_request: https://github.com/python/cpython/pull/30223

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23522] Misleading note in Statistics module documentation

2021-12-21 Thread Mark Dickinson


Change by Mark Dickinson :


--
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-21 Thread Zachary Ware


Change by Zachary Ware :


--
hgrepos:  -413

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23522] Misleading note in Statistics module documentation

2021-12-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28445
pull_request: https://github.com/python/cpython/pull/30220

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23522] Misleading note in Statistics module documentation

2021-12-21 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 7.0 -> 8.0
pull_requests: +28444
pull_request: https://github.com/python/cpython/pull/30221

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: 'array.array' object has no attribute 'tostring' which 3 got it fixed?

2021-12-21 Thread Chris Angelico
On Tue, Dec 21, 2021 at 9:56 PM '2+  wrote:
>
> hi ;)
>
> got popos installed on my raspberry pi4 and it is currently running python
> 3.9.7
>
> i get this error when running my script:
>
> 'array.array' object has no attribute 'tostring'
>
> this bug seems to be pretty old .. how long should i be waiting to get it
> fixed with apt upgrade?
>
> or should i use other attribute instead?

I'd recommend reading the documentation :)

https://docs.python.org/3/library/array.html#array.array.tobytes

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


'array.array' object has no attribute 'tostring' which 3 got it fixed?

2021-12-21 Thread '2+
hi ;)

got popos installed on my raspberry pi4 and it is currently running python
3.9.7

i get this error when running my script:

'array.array' object has no attribute 'tostring'

this bug seems to be pretty old .. how long should i be waiting to get it
fixed with apt upgrade?

or should i use other attribute instead?
-- 
https://mail.python.org/mailman/listinfo/python-list


[Python-announce] [ANN] Benchmark Smil vs Scikit-image (morphological features)

2021-12-21 Thread Jose-Marcio Martins da Cruz



Hello,

We've done a comparative benchmark (speed and memory usage) with Smil and 
Scikit-Image.

Smil is a mathematical morphology dedicated library of functions. So 
comparisons are done only on this area.

We've been working on Mathematical Morphology for more than 50 years now the discipline was created here at our research 
department in the sixties. Smil inherits the experience of previous libraries and software we've been writing since the 
70's.


In just some few words, Smil can be orders of magnitude faster than Scikit-image (hundreds or even thousands) on some 
operations thanks to parallelization and vectorization (SIMD), depending on the computer architecture.


Smil doesn't replace scikit-image but may be a good complement to scikit-image 
when speed is important.

Benchmark results are available at :
https://smil.cmm.minesparis.psl.eu/smil-vs-skimage

Smil web site is here :
https://smil.cmm.minesparis.psl.eu

Comments are welcome,

Best regards

José-Marcio



--

 ---
 Jose Marcio MARTINS DA CRUZ, Ph.D.
 Ecole des Mines de Paris
 Centre de Morphologie Mathématique
 https://orcid.org/-0002-2981-7028
 ---
  Mon livre sur le spam : http://amzn.to/LEscRu
 ---

___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


[issue46107] ExceptionGroup.split()/subgroup() don't copy __note__ to parts

2021-12-21 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46107] ExceptionGroup.split()/subgroup() don't copy __note__ to parts

2021-12-21 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset c66fc0fb53b5316dc325fde3bc738890515d38a4 by Irit Katriel in 
branch 'main':
bpo-46107: ExceptionGroup.subgroup()/split() should copy __note__ to the parts 
(GH-30159)
https://github.com/python/cpython/commit/c66fc0fb53b5316dc325fde3bc738890515d38a4


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Zach, gaurawgoshwami is a spammer. Deleted added nosy, unlinked spam file and 
unrelated PR.  I have no idea what 'repository containing patch' means or how 
g. created link to non-existent? file.

--
nosy:  -asvetlov, barry, dstufft, eric.araujo, ezio.melotti, gaurawgoshwami, 
koobs, lys.nikolaou, mrabarnett, ned.deily, pablogsal, paul.moore, 
r.david.murray, ronaldoussoren, steve.dower, tim.golden, vstinner, yselivanov

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests:  -28440

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


Removed file: https://bugs.python.org/file50506/images (5).jpeg

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
Removed message: https://bugs.python.org/msg408987

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46120] Add note to `typing.Union` that it is recommended to use `|` instead

2021-12-21 Thread Nikita Sobolev


Change by Nikita Sobolev :


--
keywords: +patch
pull_requests: +28443
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30222

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41210] Docs: More description(warning) about LZMA1 + BCJ with FORMAT_RAW

2021-12-21 Thread kdrb


kdrb  added the comment:

If you are a developer and looking for a job that suits your profession then 
please follow https://kdrb.org for latest job alerts

--
nosy: +kdrb

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37295] Possible optimizations for math.comb()

2021-12-21 Thread Mark Dickinson


Mark Dickinson  added the comment:

That computation of the shift can be simplified to require only one popcount 
operation. With F and Finv as before:


def comb_small(n, k):
assert 0 <= k <= n <= Nmax
return (F[n] * Finv[k] * Finv[n-k] % 2**64) << (k ^ n ^ (n-k)).bit_count()

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46143] [docs] IO > Text Encoding info outdated

2021-12-21 Thread Eryk Sun


Eryk Sun  added the comment:

The rare circumstance in which UTF-8 mode gets enabled automatically is 
described in the following paragraph [1]:

If the PYTHONUTF8 environment variable is not set at all, then the
interpreter defaults to using the current locale settings, unless the
current locale is identified as a legacy ASCII-based locale (as
described for PYTHONCOERCECLOCALE), and locale coercion is either 
disabled or fails. In such legacy locales, the interpreter will
default to enabling UTF-8 mode unless explicitly instructed not to do
so.

Note that UTF-8 mode is never enabled automatically in Windows. In contrast to 
POSIX, the locale encoding in Windows is unrelated to the current LC_CTYPE 
locale. Instead, the locale encoding gets set to the process code page, which 
is based on the system locale by default and never changes while a process is 
running. The system locale may be incompatible with the current LC_CTYPE 
locale, Windows user locale, and preferred UI language (e.g. for text resources 
such as error messages), so try to explicitly use UTF-8 for text files whenever 
possible.

---
[1] https://docs.python.org/3/library/os.html#utf8-mode

--
nosy: +eryksun

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46144] math.log() returns improper output

2021-12-21 Thread Mark Dickinson


Mark Dickinson  added the comment:

Yes, confirmed that this is not a bug, but just one of the many consequences of 
approximating real numbers by floating-point numbers.

You may be interested in math.log2 and/or int.bit_length. math.log2(x) *may*  
give you more accurate results than math.log(x, 2) when x is a power of two, 
but there are no guarantees - we're at the mercy of the C math library here.

--
nosy: +mark.dickinson
resolution:  -> not a bug

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45235] argparse does not preserve namespace with subparser defaults

2021-12-21 Thread Frost Ming


Frost Ming  added the comment:

Per the review comments of @jiasli, I worked out a second PR to fix this issue.

This fix has less side-effect and better backward compatibility. I will leave 
the two PRs open. Any feedback is welcome.

- Frost

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37295] Possible optimizations for math.comb()

2021-12-21 Thread Mark Dickinson


Mark Dickinson  added the comment:

One approach that avoids the use of floating-point arithmetic is to precompute 
the odd part of the factorial of n modulo 2**64, for all small n. If we also 
precompute the inverses, then three lookups and two 64x64->64 unsigned integer 
multiplications gets us the odd part of the combinations modulo 2**64, hence 
for small enough n and k gets us the actual odd part of the combinations.

Then a shift by a suitable amount gives comb(n, k).

Here's what that looks like in Python. The "% 2**64" operation obviously 
wouldn't be needed in C: we'd just do the computation with uint64_t and rely on 
the normal wrapping semantics. We could also precompute the bit_count values if 
that's faster.


import math

# Max n to compute comb(n, k) for.
Nmax = 67

# Precomputation

def factorial_odd_part(n):
f = math.factorial(n)
return f // (f & -f)

F = [factorial_odd_part(n) % 2**64 for n in range(Nmax+1)]
Finv = [pow(f, -1, 2**64) for f in F]
PC = [n.bit_count() for n in range(Nmax+1)]

# Fast comb for small values.

def comb_small(n, k):
if not 0 <= k <= n <= Nmax:
raise ValueError("k or n out of range")
return (F[n] * Finv[k] * Finv[n-k] % 2**64) << k.bit_count() + 
(n-k).bit_count() - n.bit_count()


# Exhaustive test

for n in range(Nmax+1):
for k in range(0, n+1):
assert comb_small(n, k) == math.comb(n, k)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45235] argparse does not preserve namespace with subparser defaults

2021-12-21 Thread Frost Ming


Change by Frost Ming :


--
pull_requests: +28441
pull_request: https://github.com/python/cpython/pull/30219

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-21 Thread Alex Willmer


Change by Alex Willmer :


--
nosy:  -Alex.Willmer

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com