Steven D'Aprano added the comment:
You say:
"output should be empty list"
but that's not actually correct. You intend the output to be the empty list,
but if you think carefully about what happens during iteration, you should see
that the behaviour is correct.
To m
Steven D'Aprano added the comment:
I think Eric left the issue open because he was hoping to update the FAQs
and/or docs with information about this issue.
I will leave it to someone else to decide whether or not to reopen it.
--
___
P
Steven D'Aprano added the comment:
Matt, you can add this to your own unit tests by just subclassing
unittest.TestCase and adding a new assertDuration method. Copy the existing
method's implementations (its open source and you should have the source code
already, but if not you c
Steven D'Aprano added the comment:
Even if I agreed that this method "makes no sense", and I don't, removing it
would be gratuitous breakage.
Why should we break potentially thousands of people's code who are happily
using this method, merely because you say that pe
Steven D'Aprano added the comment:
On Thu, Oct 01, 2020 at 04:37:28PM +, Damian Yurzola wrote:
> I was inspired to file this bug after reading through a multiplicity
> of bugs introduced by folks confused by the library's behavior.
Are these public bug reports or private
Steven D'Aprano added the comment:
Please forgive me if my answer is a little bit brusque, but we get essentially
this same bug report regularly, only the numbers are different.
This is not a bug in Python, it is an unavoidable consequence of how floating
point arithmetic works in
Steven D'Aprano added the comment:
Some further resources:
https://stackoverflow.com/questions/8215437/floating-point-accuracy-in-python
https://stackoverflow.com/questions/21895756/why-are-floating-point-numbers-inaccurate
https://stackoverflow.com/questions/1089018/why-cant-de
Steven D'Aprano added the comment:
Hi Leonard,
Any number which has only fixed precision will experience similar
issues. It might affect different calculations.
In Python, float, complex and Decimal have fixed precision, so they can
experience this issue.
But for simple calcula
Steven D'Aprano added the comment:
Oh no, you have discovered our dirty secret! Python is racist against Russia!
/sarcasm
Python is created by volunteers, including the documentation. If you want a
Russian translation, feel free to start working on one.
You could start here:
Steven D'Aprano added the comment:
Please don't post screen shots of text when you can post a direct link to the
page.
Are you talking about this?
https://docs.python.org/3/c-api/arg.html?highlight=py_cleanup#other-objects
This is a bug tracker, for reporting bugs in the Python i
Change by Steven Yan :
--
assignee: terry.reedy
components: IDLE
nosy: sy, terry.reedy
priority: normal
severity: normal
status: open
title: Extra Space Between "Oct" and "5"
type: enhancement
versions: Python 3.9
___
Py
Change by Steven Yan :
--
title: Extra Space Between "Oct" and "5" -> Top Sentence Had a Extra Space
Between "Oct" and "5"
___
Python t
Steven D'Aprano added the comment:
This is not a bug. In Python 2, zip() returns a list, so you can use it over
and over again. But in Python 3, zip() returns an iterator, and you can only
use iterators once. After you have used the iterator, it is exhausted and there
is nothing left
Steven D'Aprano added the comment:
On Wed, Oct 14, 2020 at 12:45:55AM +, Damian Yurzola wrote:
> And you also see people doing date math on datetime.date.today which
> will result in different answers through out the day.
Yes? Is this a problem? If I ask the question &quo
Change by Steven D'Aprano :
--
title: f***ing setup failed is driving me insane -> setup error on windows
___
Python tracker
<https://bugs.python.org
Change by Steven D'Aprano :
--
components: +Installation -Unicode
type: crash -> behavior
___
Python tracker
<https://bugs.python.org/issue42074>
___
_
Steven D'Aprano added the comment:
Hi CaptainMitsumoto,
Did you follow the instructions given by the installer to read the log file? We
don't have access to your log file, only you do. Can you see what file cannot
be found?
Did you try some basic googling? I'm not a Windows
Steven D'Aprano added the comment:
3.9 and older are all in feature freeze, so no changes in behaviour will be
considered for them.
I'm afraid I cannot replicate the behaviour you describe. When I try, the full
warning message is correctly displayed. See the attached file.
Im
Steven D'Aprano added the comment:
Eric I would normally agree with you but the only thing which gives me pause is
the statement that this doesn't occur with C, Lua and Perl.
That alone doesn't mean much. Different interpreters can use different
algorithms for printing
Steven D'Aprano added the comment:
It looks like Python is correct and the other languages may be just truncating
the output.
In the Lua interpreter:
> =277*0.1
27.7
> = 277*0.1 == 27.7
false
Perl:
$ perl -e "use feature qw(say); say 277*0.1"
27.7
$ perl -e "us
Change by Steven Yan :
--
components: Distutils
files: pic.png
nosy: dstufft, eric.araujo, sy
priority: normal
severity: normal
status: open
title: "import setuptools" Results in "ModuleNotFoundError: No module named
'_distutils_hack'"
type: behavior
v
Change by Steven Yan :
Added file: https://bugs.python.org/file49551/pic.png
___
Python tracker
<https://bugs.python.org/issue42204>
___
___
Python-bugs-list mailin
Change by Steven Yan :
Removed file: https://bugs.python.org/file49550/pic.png
___
Python tracker
<https://bugs.python.org/issue42204>
___
___
Python-bugs-list mailin
Steven D'Aprano added the comment:
See:
#26789 #39513
Serhiy, is a test case still needed? Should this be closed and pushed back to
fixing logging?
--
nosy: +steven.daprano
___
Python tracker
<https://bugs.python.org/is
Steven D'Aprano added the comment:
This is not a bug. The sequence repetition operator does not *copy* items, as
explained here:
https://docs.python.org/3/library/stdtypes.html#common-sequence-operations
--
nosy: +steven.daprano
resolution: -> not a bug
stage: -> reso
Steven D'Aprano added the comment:
Sorry, this is not a bug, but working as designed. Default values for functions
and methods are only created once, when the function is created, not on every
call.
This is a FAQ:
https://docs.python.org/3/faq/programming.html#why-are-default-values-s
Steven D'Aprano added the comment:
See also my comment here:
https://bugs.python.org/msg361451
--
___
Python tracker
<https://bugs.python.org/is
Steven D'Aprano added the comment:
PEP 594 is a draft, it has not been accepted. It is premature to start
cancelling perfectly good modules and breaking people's code.
https://conroy.org/breaking-python-packages
If you have some concrete reason for removing the binhex module,
Steven D'Aprano added the comment:
Works for me:
>>> chr(1839)+'1'
'ܯ1'
You are mixing a right-to-left code point (DHALATH) with a left-to-right code
point (digit 1). The result depends on the quality of your console or terminal.
Try using a different ter
Steven D'Aprano added the comment:
As a new feature, it can only go into 3.10. All other versions have reached
feature-freeze and can accept no new features.
We might argue that rotations should have always been written as
"anticlockwise" and "clockwise", but they
Steven D'Aprano added the comment:
On Tue, Nov 10, 2020 at 09:55:40AM +, Serhiy Storchaka wrote:
> If clockwise is a new
> standard for this command in modern Turtle implementation, we can add
> yet one alias. Otherwise I agree with Raymond.
I had a very quick loo
Steven D'Aprano added the comment:
As Larry said, yes, this is expected behaviour, and has nothing to do with the
for loop. The purpose of defaultdict is that dict lookups create the entry if
it doesn't exist:
>>> from collections import defaultdict
>>> d = defa
Steven D'Aprano added the comment:
Hi Rose, this is a FAQ:
https://docs.python.org/3/faq/programming.html#why-are-default-values-shared-between-objects
although it's also a feature that does cause beginners some trouble, see for
example my comment here for more informati
Steven D'Aprano added the comment:
This is not a bug, it is normal handling of `and` and `or` operators since
Python 1.5 and possibly older.
The `and` and `or` operators are *short-cut* operators. This is intentional
design, so we can write things like:
if mylist and mylist[0] ==
Steven D'Aprano added the comment:
This is standard Windows behaviour, and goes back to DOS days. Reserved
filenames and illegal characters are described here:
https://docs.microsoft.com/en-gb/windows/win32/fileio/naming-a-file?redirectedfrom=MSDN
If the Windows OS and file system doe
Steven D'Aprano added the comment:
A string prefix would be a large language change that would need to go through
Python-Ideas, a PEP and Steering Council approval. Let's not go there :-)
A new string method is a comparatively small new feature that probably won't
need a
Steven D'Aprano added the comment:
Why do you care what the implementation of the private methods are? Does it
make them faster or fix a bug? How is it "convenient" to change the
implementation to ternary if?
Without some better justification, this strikes me as just co
Steven D'Aprano added the comment:
You can learn more about unicode and encodings:
https://www.joelonsoftware.com/2003/10/08/the-absolute-minimum-every-software-developer-absolutely-positively-must-know-about-unicode-and-character-sets-no-excuses/
https://pyvideo.org/pycon-us-2012/prag
Steven D'Aprano added the comment:
That is the correct output.
Kshitish, Python is a mature language (about 30 years old) used by tens or
hundreds of thousands of people every day. Did you believe that you were the
only person who noticed that Python cannot even run `if...else` state
Steven D'Aprano added the comment:
Correct output.
https://docs.python.org/3/reference/expressions.html#operator-precedence
a = 10
b = 10
(a >= 10) and not (b == 10) | 7+2 == 9
returns False because of operator precedence. It evaluates like this:
(a >= 10) and not (b == 10)
Steven Bethard added the comment:
Sounds like an excellent plan to me too.
--
___
Python tracker
<http://bugs.python.org/issue13850>
___
___
Python-bugs-list m
Steven D'Aprano added the comment:
Nick Coghlan wrote:
> Nick Coghlan added the comment:
>
> 1. Any syntax change requires a PEP (and, IMO, any such PEP for this issue
> should get rejected: I don't consider this an important enough feature to
> deserve dedicate
Steven D'Aprano added the comment:
[...]
My comment has been overtaken by additional comments by Nick on the Python-Dev
list.
--
___
Python tracker
<http://bugs.python.org/i
Steven Bethard added the comment:
This is a new feature, not a bug, so I think the correct fix is to change the
2.7 documentation, since at this point 2.7 can only get bugfixes, not new
features.
--
___
Python tracker
<http://bugs.python.
Steven D'Aprano added the comment:
Patrick Westerhoff wrote:
> Patrick Westerhoff added the comment:
>
> I have to agree with Georg on that. I think it would make more sense to
> introduce some internal flag/variable that keeps track of if the cause was
> explicitely set.
Steven Bethard added the comment:
The idea and patch seem okay to me. Needs tests though.
--
___
Python tracker
<http://bugs.python.org/issue13966>
___
___
Pytho
Steven Bethard added the comment:
See nargs=argparse.REMAINDER for an approach that doesn't require that first
'--':
http://docs.python.org/library/argparse.html#nargs
But yeah, removing more than one '--' is probably a bug. Fixing it would be a
little backwards i
Steven Bethard added the comment:
The implementation looks along the right track. Now it just needs some tests.
--
___
Python tracker
<http://bugs.python.org/issue9
Steven Bethard added the comment:
I have no objections on adding a howto, and something like the attached patch
would be fine with me (though I don't have time to review it in full and trust
you to).
You might want to coordinate with Issue 13850 a bit - they want a quick
reference
Steven Bethard added the comment:
Yeah, the intention was that you could just override _get_args in a subclass to
get a better __repr__. I think these days all the argparse classes only have
keyword arguments, so _get_args probably isn't necessary an
Steven Bethard added the comment:
Oh ok. Sounds good then!
--
___
Python tracker
<http://bugs.python.org/issue14034>
___
___
Python-bugs-list mailing list
Unsub
Steven Bethard added the comment:
I think adding a new formatter for man pages would be generally useful.
Assuming someone provides a patch. ;-)
--
___
Python tracker
<http://bugs.python.org/issue14
Steven Bethard added the comment:
Yeah, the same issues have been discussed in Issue 4256. My feeling so far is
that if there isn't "one true format" that argparse can produce and be useful
to a wide variety of shells, then it's probably not functionality that belongs
Steven Bethard added the comment:
So it seems like what bash needs and what zsh needs are pretty different. My
feeling so far is that if there isn't "one true format" that argparse can
produce and be useful to a wide variety of shells, then it's probably not
functiona
Steven Bethard added the comment:
Yes, this is a known bug (Issue 11874). Patches welcome.
--
resolution: -> duplicate
superseder: -> argparse assertion failure with brackets in metavars
___
Python tracker
<http://bugs.python.org/i
Steven Bethard added the comment:
Looks like the problem is that "_format_action_invocation" is not being as
careful with the different possibilities for metavar as "_format_args" is.
Patches welcome!
--
___
P
Steven Bethard added the comment:
It's undocumented, and it begins with an underscore, but it would certainly be
safer to deprecate it first.
--
___
Python tracker
<http://bugs.python.org/is
Steven Bethard added the comment:
For optional flags like --foo-bar, argparse does munge the "dest" to "foo_bar",
following optparse. For positional arguments, arpgarse doesn't munge things
this way, but if you want the argument named "foo-bar" in help messa
Steven Bethard added the comment:
> making Namespace subscriptable
This has been discussed before - see issue 11076. I prefer to keep Namespace as
simple as possible. For subscripting, just use the standard Python idiom of
vars as suggested in the docs:
http://docs.python.org/libr
Steven Bethard added the comment:
Yes, the problem is in FileType.__call__ - the handling of '-' is pretty
simplistic. Patches welcome.
--
___
Python tracker
<http://bugs.python.o
Steven Bethard added the comment:
This behavior is intentional - positional arguments must be sequential, not
broken up with optional (flag) arguments between. So this is a documentation
bug.
Allowing positional arguments to be broken up with optional (flag) arguments
between them would be
Steven Bethard added the comment:
> optparse, which argparse attempts to replace, permitted positional
> arguments to be intermixed with optional arguments
Sure, but optparse didn't actually parse positional arguments - it just threw
them into a bag, and then you had to gro
Steven Bethard added the comment:
> Hence, I conclude that, unless this was spelled out in the PEP and I
> missed it, that having such boundaries is a bug
Practically speaking, we just can't change this because it will break existing
argparse scripts. Argparse has had this beh
Steven Bethard added the comment:
Thinking about it a bit more, it strikes me that maybe you could get the
behavior you want by declaring two parsers, one with just optionals, and one
with just positionals. Then:
optional_args, remaining_args = optionals.parse_known_args()
args
Steven Bethard added the comment:
Actually, that could be even simpler:
args, remaining_args = optionals.parse_known_args()
args = positionals.parse_args(remaining_args, args)
--
___
Python tracker
<http://bugs.python.org/issue14
New submission from Steven D'Aprano :
There is no link to the tracker http://bugs.python.org/ on the Python website
http://www.python.org/ (or if there is, it's so well hidden I can't see it).
I seem to remember that there used to be; whether or not there was, there
should be.
New submission from Steven D'Aprano :
The 3.3 What's New doesn't mention collections.ChainMap
--
assignee: docs@python
components: Documentation
messages: 156244
nosy: docs@python, stevenjd
priority: normal
severity: normal
status: open
title: No mention of collecti
New submission from Steven D'Aprano :
I attempted to build Python 3.3a1 but failed.
I am running Centos 5.
After running ./configure (no apparent errors), I ran make and got a whole lot
of warnings and errors, ending with:
collect2: ld returned 1 exit status
make: *** [python] Er
Steven Bethard added the comment:
Ok, I agree - I'm fine with it as a bugfix. Depending on the removal of extra
-- strings would be pretty crazy anyway. ;-)
--
___
Python tracker
<http://bugs.python.org/is
Steven Bethard added the comment:
I just tried this with grep's "-e" and "--regexp":
$ cat > temp.txt
a--b
cdef
$ grep -e-- -v temp.txt
cdef
$ grep --regexp=-- -v temp.txt
cdef
$ grep -e -- -v temp.txt
cdef
$ grep --regexp -- -v temp.txt
cdef
And with diff's
Steven Bethard added the comment:
> It prevents implementing parsers that pass strings on to another
> sub-parser or command.
...
> wouldn't you use 'parse_known_args' instead of 'parse_args'
> and pass the remaining arguments to the next script
I'll
Steven Bethard added the comment:
Yep. Closing as duplicate.
--
resolution: -> duplicate
status: open -> closed
superseder: -> argparse: allow abbreviation of sub commands by users
___
Python tracker
<http://bugs.python.or
Steven Bethard added the comment:
My mistake. I see that the error you're getting is a bad interaction between
the option in the main parser and an ambiguous option in the subparser.
--
resolution: duplicate ->
status: closed -> open
superseder: argparse: allow abbrevia
Steven D'Aprano added the comment:
Martin v. Löwis wrote:
> Martin v. Löwis added the comment:
>
> I think the core issue here is that bug reporters often don't want to "get
> involved", and don't consider themselves contributors. Instead, they post
>
Steven Bethard added the comment:
The problem is basically that _parse_known_args calls _parse_optional to
determine whether something is an optional or a positional. But _parse_optional
only checks "if arg_string in self._option_string_actions", that is, if the
string can be fo
Steven D'Aprano added the comment:
On Mon, Mar 19, 2012 at 02:51:53AM +, Martin v. Löwis wrote:
>
> Martin v. Löwis added the comment:
> I remain -1 on adding a link to the tracker to www.python.org. As long
> as we cannot really cope with the flood of bug reports that w
Steven D'Aprano added the comment:
> One issue with it is that in:
> def f():
> return " foo".dedent()
> f will have both " foo" and "foo" in its constants even if the first is not
> used anymore.
That seems to be what happens with ot
Steven D'Aprano added the comment:
Serhiy's message crossed with mine -- you should probably listen to
him over me :-)
--
___
Python tracker
<https://bugs.python.o
Steven D'Aprano added the comment:
> While the string method works pretty well, I do not think this is the best
> way.
Regardless of what we do for literals, a dedent() method will help for
non-literals, so I think that this feature should go in even if we
intend to change
Steven D'Aprano added the comment:
> It might be unclear for the following especially if `.dedent()` get
> sold as zero-overhead at compile time.
Oh, please, please, please PLEASE let's not over-sell this! There is no
promise that dedent will be zero-overhead: it is a
Steven D'Aprano added the comment:
Hi Stefan, and welcome.
This is not a help desk, you really should ask elsewhere for explanations of
how Python works. There are no bugs here: what you are seeing is standard
pass-by-object behaviour.
You are misinterpreting what you are seeing. P
Steven D'Aprano added the comment:
> @steven.daprano, would you be able to review the pull requests based
> on your original concept for this change? Thank you!
With difficulty... for technology/financial reasons, I don't have a
browser that works properly with github. Bu
Steven D'Aprano added the comment:
(Sorry, I can't comment on Github.)
Looking at PR 12954:
I'm not sure about the API for making the time used by autorange configurable.
The time taken is only used when autoranging, but the API takes it as an
argument to the constructor e
Steven D'Aprano added the comment:
Looking at PR 12953:
The only API for setting the target time is by passing it to the autorange
method directly. So I think that there's no way for the caller of
``Timer.timeit()`` or ``Timer.repeat()`` to specify a custom target time, is
Steven D'Aprano added the comment:
Michele, Alessandro, thank you both for your work! And thank you Cheryl for
managing this ticket.
I like mangrisano's design where the target time is passed as an argument to
the ``autorange`` method, although I prefer the name "target_
Steven D'Aprano added the comment:
Hi Bob, and welcome. Can you copy and paste the actual traceback or error you
get? It isn't obvious from your description what the error is.
Just glancing at the attached sample code, I see what seems to be an obvious
indentation error:
for
Steven D'Aprano added the comment:
Sorry Bob, are you telling us that the code you submitted to demonstrate
the error isn't the code that demonstrates the error?
Perhaps you could read this:
http://www.sscce.org/
for some ideas on how to submit a good bug report. It is written
Steven D'Aprano added the comment:
Sorry for the late reply.
> Just a question: why we need to check ``if number == 0:``? In the
> proposal you asked for None too. What changed? Even if the function is
> called with False, will it hurts to keep the default value?
Fai
Steven D'Aprano added the comment:
> ``if number is None or number < 0``
Sorry, that should be number == 0
--
___
Python tracker
<https://bugs.python.
Steven D'Aprano added the comment:
Why should ``all()`` special case ``range``? Apart from showing off benchmarks,
what's the point?
Should ``any()`` also special case it? How about other lazy sequences and
computed iterables, such as itertools.count objects, itertools.cyc
Steven D'Aprano added the comment:
> >> Why should ``all()`` special case ``range``? Apart from showing off
> >> benchmarks, what's the point?
>
> Mostly to avoid silly mistakes
What sort of silly mistakes?
> and the overhead of doing it would be very s
Steven D'Aprano added the comment:
For what its worth, there are concrete, practical applications for
binomial coefficients with negative arguments. They are used in
fractional calculus
https://nrich.maths.org/1365
which in turn has applications in physics, chemistry and other sci
New submission from Steven D'Aprano :
When asking for user input, it is often very helpful to be able to pre-populate
the user's input string and allow them to edit it, rather than expecting them
to re-type the input from scratch.
I propose that the input() built-in take a secon
Steven D'Aprano added the comment:
Nice! On my computer, I get about 30% speed up. Thanks Raymond.
The two PRs are status "merged". Does this mean we can close this ticket or is
there more to do? (The git workflow is still
Steven D'Aprano added the comment:
See also #36566. (Thanks Cheryl.)
I think the usability improvement for this far outweigh the decrease in
security.
The days where somebody looking over your shoulder watching you type your
password was the major threat are long gone. Hiding the leng
Steven D'Aprano added the comment:
The docs do say what super does: it returns "a proxy object that delegates
method calls to a parent or sibling class of type", just as you quoted. That
concise description is (almost) completely accurate and precise.
(I say *almost* becaus
Change by Steven D'Aprano :
--
Removed message: https://bugs.python.org/msg344892
___
Python tracker
<https://bugs.python.org/issue37176>
___
___
Pytho
Steven D'Aprano added the comment:
The docs do say what super does: it returns "a proxy object that delegates
method calls to a parent or sibling class of type", just as you quoted. That
concise description is (almost) completely accurate and precise.
(I say *almost* becaus
Steven D'Aprano added the comment:
On Fri, Jun 07, 2019 at 08:00:34AM +, Jeroen Demeyer wrote:
>
> Jeroen Demeyer added the comment:
>
> > What more do you want?
>
> Mainly: it says "a parent or sibling class of *type*" but it doesn't
> exp
Steven D'Aprano added the comment:
On Fri, Jun 07, 2019 at 09:57:11AM +, Jeroen Demeyer wrote:
> I'm having problems with the first word of "a parent or sibling class of
> type".
The first word is "a". Did you mean something else or did you mean it
801 - 900 of 1942 matches
Mail list logo