New submission from Cyker Way :
Acccording to: https://docs.python.org/3/library/functions.html#float
>If the argument is outside the range of a Python float, an OverflowError
> will be raised.
It is well known that the maximum value in IEEE 754 binary64 format is:
>>>
Cyker Way added the comment:
If python's float strictly adheres to IEEE 754 binary64 (is that so?), then the
problem may be caused by rounding. However, even in that case I still don't get
the benefits of doing range check on a rounded input but not the input itself.
Does IEEE
Cyker Way added the comment:
IEEE 754, 7.4 Overflow:
> The overflow exception shall be signaled if and only if the destination
> format’s largest finite number is exceeded in magnitude by what would have
> been the rounded floating-point result (see 4) were the exponent range
&g
Cyker Way added the comment:
Alright that helps. I guess I now understand what's happening here. Here are
the two numbers in question:
>>> M = int('1'*53+'0'*971, 2)
>>> N = int('1'*53+'0'+'1'*970, 2)
M is the large
New submission from Cyker Way :
With an inheritance graph like this:
A C
B D (X) A
E
Adding or removing class X in E's parents will change the order of A and C in
E's MRO: EBDAC vs EBDCXA.
I couldn't imagine what would
Cyker Way added the comment:
Thanks for reply. It's not about the Python's implementation of C3 but C3
itself being used as the MRO algorithm in Python. It bites when you remove an
independent interface from your class definition and its method calls become
something else.
I t
Cyker Way added the comment:
a typo:
...at this time we know we can extract X in (f1') because X is NOT in any
tail...
Missed the "NOT" in the previous text.
--
___
Python tracker
<https://bugs.pyt
Cyker Way added the comment:
Thank you for the links. I doubt this c3 variant could break EPG consistency
making it c2. May run some tests later and move on to discussion board. Guess
I'm done here.
--
___
Python tracker
<https://bugs.py
Cyker Way added the comment:
Ahhh, 1 second, I haven't really quit from this. I could open another thread
but it's highly related to this one.
I just came up with something that looks like a bug not a feature in the
original c3.
#!/usr/bin/env python3
#
Cyker Way added the comment:
Tuple support is documented:
https://github.com/python/cpython/commit/98047eb806227f11212f6a42c242030a51964e30#diff-9c4a053d29149ba40370fb3e34faR1059
https://docs.python.org/3/library/argparse.html#metavar
> Providing a tuple to ``metavar`` specifie
New submission from Cyker Way :
In short, `fnmatch.fnmatch` doesn't match shell result. To test this, create a
dir with 2 files: `a.py` and `b.py`. Then `ls [!b].py` and `ls [^b].py` will
both show `a.py`. However, `fnmatch.fnmatch('a.py', '[!b].py')` returns `Tr
Cyker Way added the comment:
Thank you for confirmation. Knowing it is not fully POSIX-compliant helps with
understanding.
I'm asking this because I had interoperability issues writing python scripts
providing shell-like utilities for filename expansion and the result may
surprise
Cyker Way added the comment:
Can confirm this bug still exists on master branch, python3.7, python3.6, and
very likely other versions since it's reported.
It seems only `_format_action_invocation` and `_get_action_name` need to be
fixed. So we can do it more lightweight (<
New submission from Cyker Way :
This piece of code will raise an error:
import os
import sys
os.set_blocking(sys.stdin.fileno(), False)
sys.stdin.read()
Error:
> TypeError: can't concat NoneType to bytes
Not sure if this is relevant (for a different version o
New submission from Cyker Way :
Document of
[BufferedIOBase](https://docs.python.org/3/library/io.html#io.BufferedIOBase)
says:
> ...unlike their RawIOBase counterparts, they will never return None.
But this example shows the above statement is not true:
import io
import
New submission from Cyker Way :
The current implementation of `pkgutil.walk_packages()` is confusing. Users may
be given incomplete results while no exception is raised if they don't
explicitly provide the `prefix` parameter. The doc says:
> prefix is a string to output on the
Change by Cyker Way :
Removed file: https://bugs.python.org/file47516/test.py
___
Python tracker
<https://bugs.python.org/issue33210>
___
___
Python-bugs-list mailin
Cyker Way added the comment:
Update test program.
--
Added file: https://bugs.python.org/file47519/test.py
___
Python tracker
<https://bugs.python.org/issue33
New submission from Cyker Way :
I'm currently writing some shell tools with python3. While python can
definitely do the job succinctly, there is one problem which made me feel I
might have to switch to other languages or even pure bash scripts: python
startup time.
Shell tools are used
Cyker Way added the comment:
> VM startup + `import site` are done in 10~20ms on common Linux machine.
> While Python VM startup is not lightning fast, library import time is much
> slower than VM startup in many cases.
In my tests, a helloworld python script generally takes ab
Cyker Way added the comment:
It was tested on a x86_64 Linux system. The machine is not quite new but is OK
for building and running python. The test script is actually a management tool
for a larger project that is not released in public so I don't have right to
disclose it here.
Cyker Way added the comment:
> While this issue is "pre warming VM", VM startup is not significant part of
> your 500ms.
10-20ms should be OK for shell scripts. But a fork is still faster.
> You're talking about application specific strategy now. It'
Cyker Way added the comment:
I'm fine with stdlib, 3rd party tools, or whatever. My focus is to understand
is whether this idea can be correctly implemented on the python VM or not. I've
been searching for similar implementations on standard JVM, but the results
mostly come fro
New submission from Cyker Way :
The current `sorted` function is somewhat limited and doesn't cover a use case
that frequently occurs in real applications: sort by a tuple of keys where each
key can be in asc or desc order.
For example, you may have a list of site configs where ea
Cyker Way added the comment:
Multi-pass stable sorts should produce the correct result. But as the number of
columns grow the code gets messy. For brevity this example only has 2 columns
but it may be 10 or more in a real application. Furthermore, in some cases the
application may need to
Cyker Way added the comment:
Previous upload `example.py` was missing `__eq__`. Updated in `example-1.py`.
--
Added file: https://bugs.python.org/file47876/example-1.py
___
Python tracker
<https://bugs.python.org/issue35
Cyker Way added the comment:
As for performance, I think both single-pass and multi-pass sorts have
worst-case time complexity `m * n * log(n)`, assuming the number of items is
`n` and each item has dimension `m`. Whichever is faster seems to be
data-dependent. So I made a more
Cyker Way added the comment:
Thank you very much for the great discussion here, especially Tim's great
threads in *python-ideas* that give neat and insightful answers to this problem
in different ways:
- <https://mail.python.org/pipermail/python-ideas/2016-October/043045.html>
New submission from Cyker Way:
Using `choices` option in `argparse` module caused unwanted behavior.
# Without `choices`
parser = argparse.ArgumentParser()
parser.add_argument('length')
parser.print_help()
## Output
usage: demo.py [-h] length
positional
29 matches
Mail list logo