[issue35247] test.test_socket.RDSTest.testPeek hangs indefinitely

2020-09-20 Thread Jáchym Barvínek
Jáchym Barvínek added the comment: I am experiencing the same issue when trying to build the ArchLinux python package. Not sure how to reproduce, but I can provide specific details of my system if requested. -- nosy: +Jáchym Barvínek ___ Python

[issue30196] Add __matmul__ to collections.Counter

2017-04-28 Thread Jáchym Barvínek
New submission from Jáchym Barvínek: The class collections.Counter should semantically contain only numbers, so it makes sense to define dot product od Counters, something like this: def __matmul__(self, other): return sum(self[x] * other[x] for x in self.keys() | other.keys()) I find this

[issue28529] 0 ** 0 should raise ArithmeticError

2016-10-25 Thread Jáchym Barvínek
Jáchym Barvínek added the comment: Sorry, It should be 0.0 ** 0 == 0 ** 0.0 == 0.0 ** 0.0 == 1.0 of course. -- ___ Python tracker <http://bugs.python.org/issue28

[issue28529] 0 ** 0 should raise ArithmeticError

2016-10-25 Thread Jáchym Barvínek
New submission from Jáchym Barvínek: 0 ** 0 is mathematically undefined and equivalent to 0/0. 0/0 correctly raises ZeroDivisionError, but 0 ** 0 == 1. Also 0.0 ** 0 == 0 ** 0.0 == 0.0 ** 0.0 == 0.0. Similarly for math.pow. -- components: Interpreter Core messages: 279410 nosy: Jáchym

[issue27858] Add identity function to functools

2016-08-25 Thread Jáchym Barvínek
Jáchym Barvínek added the comment: Java offers an identity function: https://docs.oracle.com/javase/8/docs/api/java/util/function/Function.html 2016-08-25 14:10 GMT+02:00 Steven D'Aprano : > > Steven D'Aprano added the comment: > > Just in case anyone else thinks this is

[issue27858] Add identity function to functools

2016-08-25 Thread Jáchym Barvínek
New submission from Jáchym Barvínek: An identity function is sometimes useful in functional-style programming as a dummy or default value. For example, we can sometimes see a pattern like this (e.g. in itertools.groupby): def f(params, key=None): if key is None: key = lambda x: x

[issue25625] "chdir" Contex manager for pathlib

2015-11-14 Thread Jáchym Barvínek
Jáchym Barvínek added the comment: I did not know about cwd for Popen. It seems like the better way to go. Thank you. 2015-11-14 19:58 GMT+01:00 desbma : > > desbma added the comment: > > I'm not a Python core developer, but a few thoughts: > * this is not thread safe

[issue25625] "chdir" Contex manager for pathlib

2015-11-14 Thread Jáchym Barvínek
New submission from Jáchym Barvínek: I use this context manager in my code: @contextmanager def in_directory(path): pwd = str(Path().absolute()) if not path.is_dir(): path = path.parent os.chdir(str(path)) yield path.absolute() os.chdir(pwd) I thought it would be