Can threading.Semaphore support acquire(2)?

since Semaphore.acquire() just minus one , is that possible to add a new params, like acquire(n) then I can minus n .

The idea is from Java

Semaphore H = new Semaphore(2);
H.acquire(2);
H.release(1);

If you had read the python documentation you would see that this is already implemented. See threading — Thread-based parallelism — Python 3.12.2 documentation

class threading.Semaphore(value=1 )

This class implements semaphore objects. A semaphore manages an atomic counter representing the number of release() calls minus the number of acquire() calls, plus an initial value. The acquire() method blocks if necessary until it can return without making the counter negative. If not given, value defaults to 1.

acquire(*blocking=True*, *timeout=None* )

Acquire a semaphore.
release(n=1)
Release a semaphore, incrementing the internal counter by n. When it was zero on entry and other threads are waiting for it to become larger than zero again, wake up n of those threads.

we have release(n=1) , but without acquire(n=1)

My bad I misread the docs. Sorry.