Hristo Venev added the comment:
Sorry, I must have missed Inada Naoki's reply. I will try to send a pull
request this weekend.
--
___
Python tracker
<https://bugs.python.org/issue24
Hristo Venev added the comment:
I've attached a patch that should also contain a test.
I also ran some benchmarks on dict creation/inserts. I couldn't notice any
difference in performance.
--
Added file:
https://bugs.python.org/file49782/0001-Don-t-downgrade-unicode-only-dicts
Hristo Venev added the comment:
> Why is the first key built up as vx='x'; vx += '1' instead of just k1="x1"?
I wanted to construct a key that is equal to, but not the same object as,
`'x1'`. Consider this example:
assert 'x1' is 'x1'
spam = 'x1'
assert spam is
Hristo Venev added the comment:
Benchmark program attached.
0. Creates a dict with str keys
1. str lookups
2. str subclass lookups on the same dict
3. str lookups on the same dict
Results before patch:
0.9493069459404069 +- 0.004707371313935551
1.47313450980997 +- 0.01350596115630158
Hristo Venev added the comment:
I've attached a patch. I will soon provide benchmark results.
--
keywords: +patch
nosy: +h.venev
Added file:
https://bugs.python.org/file49772/0001-Don-t-downgrade-unicode-only-dicts-to-mixed-on-non-u.patch
New submission from Hristo Venev:
`ipaddress.IPv4Network('127.0.0.0/16').reverse_pointer =
'0/16.0.0.127.in-addr.arpa'` is definitely wrong. I think it should be
'0.127.in-addr.arpa'.
A funnier case, `ipaddress.IPv6Network('2001:db8::/32').reverse_pointer =
'2.3
Hristo Venev added the comment:
Here is the OFD patch, I'll open another issue for the overflow bug.
--
versions: +Python 3.6
Added file:
http://bugs.python.org/file42093/0002-fcntl-Support-Linux-open-file-descriptor-locks.patch
___
Python tracker
Hristo Venev added the comment:
This implements the open_file_descriptor argument and fixes a bug with
converting to int when off_t is 64-bit but long is 32-bit.
--
keywords: +patch
Added file: http://bugs.python.org/file42085/0001-fcntl-support-F_OFD_.patch
Hristo Venev added the comment:
I'd like to use fd locks from python too.
--
nosy: +h.venev
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Hristo Venev added the comment:
One last thing: type(a%b) is A, type(b%a) is int.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Changes by Hristo Venev <hri...@venev.name>:
--
title: True%2==True -> True%2 is True
___
Python tracker <rep...@bugs.python.org>
<http://bugs.pyt
New submission from Hristo Venev:
Should be 1. This comes from the (a%b=a if a<b) optimization.
Let's be consistent with all other arithmetic operations.
--
components: Interpreter Core
messages: 257629
nosy: h.venev
priority: normal
severity: normal
status: open
title: True%2==T
Hristo Venev added the comment:
Quote from PEP 489:
The Py_mod_create slot is used to support custom module subclasses.
There is no way to subclass PyModuleObject from C.
--
versions: +Python 3.5 -Python 3.4
___
Python tracker <
Changes by Hristo Venev hri...@venev.name:
--
components: +Interpreter Core
versions: +Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23869
New submission from Hristo Venev:
In PyType_GenericAlloc, the initialization is being done. Namely, the PyObject
part of the object is initialized and it is tracked by the garbage collector.
In the documentation it is stated that tp_alloc should do no initialization.
--
messages
New submission from Hristo Venev:
An object starts being tracked by the GC after being allocated, but before
being initialized. If during initialization the GC runs, this may lead to
tp_traverse being called on an uninitialized object.
--
components: Interpreter Core
messages: 240079
New submission from Hristo Venev:
Please export PyModuleObject in moduleobject.h.
It's useful for subclassing module in C.
--
components: Interpreter Core
messages: 237543
nosy: h.venev
priority: normal
severity: normal
status: open
title: Export PyModuleObject in moduleobject.h
Hristo Venev added the comment:
Should I file bugs for is_dir, is_file, is_symlink, is_socket, is_fifo,
is_block_device and is_char_device?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22759
New submission from Hristo Venev:
$ touch a
c: stat(a/x, ...) - errno=ENOTDIR
$ python
pathlib.Path('a/x').exists()
This should return False and not throw an exception.
Patch not tested.
--
files: py.patch
keywords: patch
messages: 230214
nosy: h.venev
priority: normal
severity
Hristo Venev added the comment:
Tested and works.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22759
___
___
Python-bugs-list mailing list
Hristo Venev added the comment:
ENAMETOOLONG and possibly ELOOP should also return False.
EACCES, EOVERFLOW and ENOMEM should probably be forwarded.
EFAULT should not happen.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Hristo Venev added the comment:
My questions are:
When will SSLSocket.recv() raise SSLWantWriteError?
When will SSLSocket.send() raise SSLWantReadError?
According to my very basic knowledge abou the protocol, this will never happen.
--
___
Python
New submission from Hristo Venev:
ssl.SSLWantReadError and ssl.SSLWantWriteError should inherit
io.BlockingIOError.
Generic code that works with non-blocking sockets will stop working with
SSLSockets.
Does anybody have any idea if SSLSocket.read() will need to write to the
underlying socket
Hristo Venev added the comment:
After optimization, tests on small ints ( 2**30)
Currently only addition, subtraction, negation and ~ are a bit slower ( 5%).
Most other operations are the same. Bitwise operators, //, %, ** and pow are
faster.
Converting to and from strings is a bit faster
New submission from Hristo Venev:
I have implemented the PyLong interface using the GMP mpn functions. API/ABI
compatibility is retained (except for longintrepr).
It can be enabled by passing --enable-big-digits=gmp to ./configure.
No large performance regressions have been observed for small
Hristo Venev added the comment:
PyLongObject is a PyVarObject. It contains many mp_limb_t's. There is little
overhead. For some operations if the result is in [-20;256] no memory will be
allocated. There are special codepaths for 1-limb operations.
And I just finished GDB support.
Please
Hristo Venev added the comment:
After some minor optimizations my implementation is about 1.8% slower on
pystone and about 4% slower on bm_nqueens. It's 4 times faster on bm_pidigits.
--
___
Python tracker rep...@bugs.python.org
http
New submission from Hristo Venev:
PyObject* PyLong_FromString(const char *str, char **pend, int base)
pend should be const char**
I think casting const away when not required should be a crime punishable by
imprisonment.
--
messages: 222152
nosy: h.venev
priority: normal
severity
Changes by Hristo Venev hri...@venev.name:
--
components: +Interpreter Core
type: - security
versions: +Python 3.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21909
Hristo Venev added the comment:
What about using PyVarObject of mp_limb_t and mpn instead of mpz_t?
Addition:
- Check signs and allocate.
- Possibly compare absolute values.
- Call mpn_(add|sub)_n and possibly mpn_(add|sub)_1 if the integers have
different sizes.
- Overhead
Hristo Venev added the comment:
I will not add PyLong_AsUnsigned*AndOverflow in my code because I don't want my
code to depend on the exact implementation of PyLong.
Are you seriously calling a 50-line function feature?
Anyway... I propose splitting the patch in two parts:
- cleanup
Hristo Venev added the comment:
I did not intend to make it so that PyLong_AsUnsignedLong* to call __int__ but
it looks like a good idea because PyLong_AsLong* does that and the patch is
exactly about that - removing differences between converting to signed and
unsigned.
Should I upload
Hristo Venev added the comment:
Please apply in 3.4.1. I need this ASAP.
--
versions: +Python 3.4 -Python 3.5
Added file: http://bugs.python.org/file34738/a
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2
Hristo Venev added the comment:
Will you release 3.5 in the next few weeks?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2
___
___
Python
New submission from Hristo Venev:
It could set *overflow to -1 on negative value and to 1 on overflow.
And PyLong_AsUnsignedLongLongAndOverflow.
--
components: Extension Modules
messages: 215236
nosy: h.venev
priority: normal
severity: normal
status: open
title
New submission from Hristo Venev:
Some programs' behavior is different depending on whether the path has a
trailing slash or not. Examples include ls, cp, mv, ln, rm and rsync. URL paths
may also behave differently. For example http://xkcd.com/1 redirects to
http://xkcd.com/1
Hristo Venev added the comment:
What about OpenVMS?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21039
___
___
Python-bugs-list mailing list
Hristo Venev added the comment:
AFAIK paths on OpenVMS are represented in a strange way. [dir.subdir]filename
is a path for a file and [dir.subdir.anothersubdir] is a path for a directory.
--
___
Python tracker rep...@bugs.python.org
http
Hristo Venev added the comment:
Or maybe URLPath?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21039
___
___
Python-bugs-list mailing list
New submission from Hristo Venev:
It would be better if string literals could be used there.
--
messages: 214451
nosy: h.venev
priority: normal
severity: normal
status: open
title: PyMethodDef ml_name is char* instead of const char*
___
Python
New submission from Hristo Venev:
It would be better if string literals could be used there.
--
messages: 214453
nosy: h.venev
priority: normal
severity: normal
status: open
title: PyMemberDef name is char* instead of const char*
___
Python tracker
New submission from Hristo Venev:
It would be better if string literals could be used there.
--
messages: 214452
nosy: h.venev
priority: normal
severity: normal
status: open
title: PyMethodDef ml_doc is char* instead of const char*
___
Python tracker
New submission from Hristo Venev:
It would be better if string literals could be used there.
--
messages: 214454
nosy: h.venev
priority: normal
severity: normal
status: open
title: PyMemberDef doc is char* instead of const char*
___
Python tracker
New submission from Hristo Venev:
It would be better if string literals could be used there.
--
components: Extension Modules
messages: 214455
nosy: h.venev
priority: normal
severity: normal
status: open
title: PyTypeObject tp_name is char* instead of const char*
versions: Python 3.4
New submission from Hristo Venev:
It would be better if string literals could be used there.
--
components: Extension Modules
messages: 214456
nosy: h.venev
priority: normal
severity: normal
status: open
title: PyTypeObject tp_doc is char* instead of const char*
versions: Python 3.4
Changes by Hristo Venev hri...@venev.name:
--
components: +Extension Modules
versions: +Python 3.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21021
Changes by Hristo Venev hri...@venev.name:
--
components: +Extension Modules
versions: +Python 3.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21022
Changes by Hristo Venev hri...@venev.name:
--
components: +Extension Modules
versions: +Python 3.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21019
Changes by Hristo Venev hri...@venev.name:
--
components: +Extension Modules
versions: +Python 3.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21020
Hristo Venev added the comment:
error: deprecated conversion from string constant to ‘char*’
I like -Werror.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21019
Hristo Venev added the comment:
g++
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21019
___
___
Python-bugs-list mailing list
Unsubscribe
New submission from Hristo Venev:
This really annoys me. I have to store the literals in char[] and then make a
char*[] from them. It would be better if a simple array of string literals
could be used. It would also require less data space because string literals
could be merged
52 matches
Mail list logo