Steven D'Aprano added the comment:
Marco, it is better to give a description of the functionality required rather
than a simplistic and incorrect implementation :-)
(Not that I am likely to provide a better implementation without a lot of
study.)
Regardless of whether you or I agree
Steven D'Aprano added the comment:
One issue per ticket please.
Versions 3.9 and older are all in feature freeze, they will not get new
features.
Combining a global declaration with an assignment has been requested before,
and rejected. If you want to discuss that feature again, you s
Steven D'Aprano added the comment:
Okay Marco, I'm changing the title to reflect the new API (support for rounding
modes rather than new round functions) and pushed the version to 3.10, since
3.9 is in feature freeze (no new features).
This will probably need to be discussed on Py
Steven D'Aprano added the comment:
I don't think that Python, a computer language, IS an approach to OOP. A
programming language HAS an approach to OOP.
We would say "Python's approach to OOP is ..." so the approach is something
that belongs to Python, it isn
Steven D'Aprano added the comment:
"Unordered" means that the language doesn't promise any specific order, it
doesn't mean that there is no order at all.
Try strings:
py> set("abcdef")
{'b', 'f', 'c', 'e', &
Steven D'Aprano added the comment:
Here's another example:
py> set([1, 2**63, 4, -5, 6, 5])
{1, 9223372036854775808, 4, 6, 5, -5}
By the way, in the future, please don't post screen shots of text, copy the
code and output and paste it as text into your bug report. S
Steven D'Aprano added the comment:
I agree with xtreak. I guess you probably misspelled the initial word:
>>> 'Python'[2:5] # same as the tutorial
'tho'
>>> 'Pyhton'[2:5] # misspelling
'hto'
--
nosy: +steven.daprano
Steven D'Aprano added the comment:
You can't end a string with a bare backslash, not even an raw string.
--
nosy: +steven.daprano
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<h
Steven D'Aprano added the comment:
See the FAQ:
https://docs.python.org/3/faq/design.html#why-can-t-raw-strings-r-strings-end-with-a-backslash
Also documented here:
https://docs.python.org/dev/reference/lexical_analysis.html#string-and-bytes-literals
Previous issues: #1271 and #
Steven D'Aprano added the comment:
Generating a range of equally-spaced floats is tricky and the range builtin is
not the right solution for this.
For numerical work, we often need to specify the number of steps, not the step
size. For instance, in numeric integration, we often li
Steven D'Aprano added the comment:
As Marco says, the exception message is because the default value for start is
0, and you can't concatenate strings to the integer 0.
You get the same error if you try to concatenate lists:
py> sum([[], []])
TypeError: unsupported o
Steven D'Aprano added the comment:
Marco, sum should be as fast as possible, so we don't want to type check every
single element. But if it is easy enough, it might be worth checking the first
element, and if it fails, report:
cannot add 'type' to start value
wher
Steven D'Aprano added the comment:
Hello David,
I really don't think you speak for the entire LGBTQ community. You don't speak
for me or my wife.
You mention two issues here:
"First is that break and continue don't allow the programmer to do anything,
they cause
Steven D'Aprano added the comment:
On Tue, Sep 08, 2020 at 06:23:58PM +, David Williams wrote:
> Steven, it sounds like we agree to the change proposal, which is to
> remove gendered language from the documentation.
What?
Did you even read w
Steven D'Aprano added the comment:
This is not a bug, it is working as designed. Importing takes the module from
the cache. You can either delete the module from the cache:
del sys.modules['modulename']
import modulename # reloads from the module file
or possib
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
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
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 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 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.
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 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 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
Steven D'Aprano added the comment:
> If you have to explain in a bpo issue how the doc should be read, that
> proves exactly my point that it's confusing. The fact that it's
> technically correct if you read it the right way is irrelevant.
Do you expect the docs t
Steven D'Aprano added the comment:
In addition to being a third-party library, according to the output you posted,
you're actually running Python 3.4 not 3.7.
--
nosy: +steven.daprano
___
Python tracker
<https://bugs.python.o
Steven D'Aprano added the comment:
> I'm sorry to say that you're wrong here.
I'm happy to be corrected.
It is fair to say I failed to take the multiple inheritance case into
account. Clearly super can't *only* look at the MRO of the first object
since
Steven D'Aprano added the comment:
> > What matters is the __mro__ attribute of the first argument. It matters
> because that is how the MRO actually is searched.
>
> By the way, if it was true (it is not),
Yes, I see that now.
> then what did you think was
>
Steven D'Aprano added the comment:
On Sat, Jun 08, 2019 at 09:14:18PM +, Raymond Hettinger wrote:
> Ideally, the text can also be made more compact. Having eight
> paragraphs sends an implicit message that this is too complex to
> understand and that it should be avoid
Steven D'Aprano added the comment:
> (message from a code of conduct violating troll deleted)
How did Bachsau violate the code of conduct, and what evidence do you
have that they were anything but 100% sincere in their comments?
>From where I am sitting, the only person violating
Steven D'Aprano added the comment:
Bachsau,
to respond to the substance of your comments: it is not the *primary*
purpose of a compiler to teach, but compiler warnings on potentially
wrong behaviour is a long-standing tradition in many languages,
including Python.
This is not the
Steven D'Aprano added the comment:
This looks like some sort of spam or joke.
There's no explanation given of what this enhancement does, the PR seems to add
only a rather suspicious looking triple-quoted string. (Possibly really bad
ASCII art of a finger?)
In the absence of any
Steven D'Aprano added the comment:
For the reasons already discussed on the Stackoverflow link you gave, Python
does not have pre- and post-increment and -decrement operators, and probably
never will.
I'm closing this ticket as Won't Fix, but if you wish to discuss it fu
Steven D'Aprano added the comment:
Support for "~" isn't strictly part of the POSIX file system standard, it is a
*shell* shortcut. As far as the file system is concerned, "~" is just a regular
character like any other.
--
Steven D'Aprano added the comment:
It is a *syntax* error. You have written bad syntax, just as the error message
says. Your \xXX code is too short, only 1 hex digit instead of 2. I disagree
that this should be a value error: it isn't a bad value, it is bad syntax.
I don'
Steven D'Aprano added the comment:
Could you supply a *simple* demonstration of a class showing this problem? I've
looked at the uploaded "test6.py" (what happened to the other 5?) and don't see
anything to do with either __getattr__ or property in it.
---
Steven D'Aprano added the comment:
I don't think that will work. If the user passes a non-string which is falsey,
your patch will attempt to write it directly to the stream without converting
it to a string.
Try ``_raw_input(0)`` as an example.
Tal Einat:
> one would expect p
Change by Steven D'Aprano :
--
nosy: +steven.daprano
___
Python tracker
<https://bugs.python.org/issue37454>
___
___
Python-bugs-list mailing list
Unsubscr
Steven D'Aprano added the comment:
Here are links to the relevant docs:
https://docs.python.org/3/library/stdtypes.html#str.startswith
https://docs.python.org/3/library/stdtypes.html#str.endswith
Both say:
"With optional *start*, test string beginning at that position. With opti
Steven D'Aprano added the comment:
Perhaps it would help if we spelled out the behaviour more explicitly?
str.startswith(prefix[, start=0[, end=len(string)]])
Return True if the slice of string between start (defaults to the beginning
of the string) and end (defaults to the end o
Steven D'Aprano added the comment:
> it would be better for an exception to be thrown rather than creating a
> corrupt folder.
I am not convinced that Python should refuse to create a perfectly valid
directory because some components of Windows sometimes have trouble resolving
t
Steven D'Aprano added the comment:
Eric is correct that this is a CPython optimization, it is not a language
feature.
Furthermore, it is an optimization that can be affected by rather subtle
factors such as the operating system memory management. Here is a thread
demonstrating that
601 - 700 of 1443 matches
Mail list logo