Steven D'Aprano added the comment:
This is not a bug, it is part of the design of the language. Assignment in
Python does not make a copy of lists, or any other object. In your sample code,
p and l are two names for the same list, like "Devor Blake Daniels" and
"dev4057
Change by Steven D'Aprano :
--
nosy: +pablogsal
___
Python tracker
<https://bugs.python.org/issue38458>
___
___
Python-bugs-list mailing list
Unsubscr
Steven D'Aprano added the comment:
Define "malfunction". Are we supposed to know what your code is meant to do, as
well as what it actually does?
Please don't use the bug tracker as a help desk for your own scripts. There are
many forums where you can ask for help, such
Steven D'Aprano added the comment:
I can't speak for other countries, but in Australia, secondary school
mathematics teaches correlation coefficient and linear regression from
Year 11 onwards (typically ages 16 or 17). Covariance is not itself
taught, and as far as I can tell neit
Steven D'Aprano added the comment:
I believe that the interpreter only requires that each block is consistent, not
that all blocks in a module are consistent.
--
nosy: +steven.daprano
___
Python tracker
<https://bugs.python.org/is
Steven D'Aprano added the comment:
What is this a screen shot of?
What error occurs? The picture doesn't show any errors that I can see.
Please COPY and PASTE the code you are running, as text, and the FULL EXCEPTION
(the traceback and error message), if there is one. We cannot
Steven D'Aprano added the comment:
Why would they give the same result when the code is different?
#1 assign c, d, e and everything left over goes into b
*b, c, d, e, = [1, 2, 3, 4]
#2 assign c, d and everything left over goes into b
*b, c, d, = [1, 2, 3, 4]
#3 ass
Change by Steven D'Aprano :
--
title: Provide Class' end line in readmodule module -> Provide Class' end line
in pyclbr module
___
Python tracker
<https://bugs.
Steven D'Aprano added the comment:
The documentation doesn't mention ``__set_name__``, but it does say that
cached_property is useful for properties which are "effectively immutable".
The ``__set_name__`` error message is pretty cryptic, that seems to have
something
Steven D'Aprano added the comment:
We're not mind-readers, how do you expect us to know what you tried if you
don't tell us?
The walrus operator works for me:
>>> [spam for c in "hello world" if (spam:=c.upper()) in 'AEIOU']
['E
Change by Steven D'Aprano :
--
components: +Interpreter Core
type: enhancement -> behavior
___
Python tracker
<https://bugs.python.org/issue38556>
___
_
Steven D'Aprano added the comment:
Also, next time I suggest that you try running the code at least once before
submitting it, as your code contains a syntax error that prevents it from
running.
--
nosy: +steven.daprano
___
Python tracker
&
Steven D'Aprano added the comment:
This is an intentional feature: identifiers are normalised using NFKC
normalization.
py> from dis import dis
py> dis(compile('ฯ=1', '', 'single'))
1 0 LOAD_CONST 0 (1)
Steven D'Aprano added the comment:
Its also documented here:
https://docs.python.org/3/reference/lexical_analysis.html#identifiers
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https:
Steven D'Aprano added the comment:
Please explain the bug here on the bug tracker, people shouldn't have to drill
down into the PR to find out what it means.
Before fixing the bug, you should find out whether or not it actually is a bug.
In my testing, the comment is approximate
Steven D'Aprano added the comment:
Thank you for your comments, but accepting non-floats like Decimal and
Fraction (and int, of course!) is a hard requirement for the statistics
module. fmean will naturally convert any data to float for speed, but
the other means will attempt to kee
Steven D'Aprano added the comment:
Have you read the rest of the thread? There is a compelling reason to
support harmonic mean including zero (resistors in parallel) but not yet
any compelling reason to support negative values.
If you have a good use-case for harmonic mean of neg
Steven D'Aprano added the comment:
I agree with Serhiy that using mutable defaults is not automatically a bad
idea. This is unnecessary code churn that fixes no bugs and adds no new
functionality and doesn't make the code "better".
The PR removes one harmless use of a
Steven D'Aprano added the comment:
> Also, if some new Python coders saw `[]` or `{}` being used as default
> values in the standard library, they might think โIโll do it too since
> the standard library does itโ.
Great! Having Python coders learn good progamming skills from
Steven D'Aprano added the comment:
Possibly even easier than using Decimal:
py> '%.17f' % 0.95
'0.94996'
BTW, this is a FAQ:
https://docs.python.org/3/faq/design.html#why-are-floating-point-calculations-so-inaccurate
Steven D'Aprano added the comment:
I'm reopening this as an enhancement, because I think Mikeli is onto something
here. I'd like to propose making the messages:
"False is not a truthy value."
"True is not a falsey value."
to make it expli
Steven D'Aprano added the comment:
Since error messages aren't part of the API and backwards-compatibility doesn't
apply to them, this could still go into 3.8.
--
stage: resolved ->
versions: +Python 3.8 -Python 3.9
___
Pyth
Steven D'Aprano added the comment:
I have tried sending this message by email twice, and both times it seems to
have disappeared. So I'm commenting via the web, and my apologies in advance if
the message shows up later.
*
> There are almost 500 occurrences of "is tr
Steven D'Aprano added the comment:
This seems to be the difference between Universal Newlines or not. In Python 2,
you have to set it explicitly with a U in the open mode:
$ python2.7 -c 'import sys; print("Linecount=", sum(1 for x in
open(sys.argv[1], "U
Steven D'Aprano added the comment:
Please don't ask us to guess what you are doing.
Where are you getting "both installer downloads" from? What installers are they?
How are you running the installers?
What is the actual error message please, not "something to th
Steven D'Aprano added the comment:
This is not a bug, it is working as intended.
Python does not really support "private" attributes, except by convention.
Names that begin with a single leading underscore are no different than any
other name to the interpreter, but the rea
Steven D'Aprano added the comment:
Yann,
Eric is correct -- this isn't a help desk. Please ask your question on one of
the many forums available for asking help, but before you do, please read:
http://www.sscce.org/
https://stackoverflow.com/help/minimal-reproducible-example
an
Steven D'Aprano added the comment:
This is normal, expected behaviour and has nothing to do with defaultdicts
specifically. Any mutable object would behave the same way.
Function default parameters are evaluated only once, when the function is
defined. They are not re-evaluated on each
Steven D'Aprano added the comment:
> the result is different from other languages which is why it can be
> surprising.
Maybe the other languages should be documenting their surprising result, which
fails to preserve the identity?
> Do we - add a warning to the [tutorial] page
Steven D'Aprano added the comment:
The behaviour of `is` is correct.
The `is` operator tests for object identity, not equality. The reason that
`slice(None) is slice(None)` returns False is that the two calls to the slice
function return two different objects.
You say that using the e
Steven D'Aprano added the comment:
Hello Santosh,
In future, please don't post images or screen shots of text, please copy and
paste the text of your code.
You have something similar to this:
>>> text = "short line\rvery long line of text"
>>> print(
Steven D'Aprano added the comment:
What do you mean? It works as I expected. Can you explain what you expected,
and why?
--
nosy: +steven.daprano
___
Python tracker
<https://bugs.python.org/is
Steven D'Aprano added the comment:
Before replying please read:
https://docs.python.org/3/faq/design.html#why-are-floating-point-calculations-so-inaccurate
https://duckduckgo.com/?q=python+why+are+floating+point+so+inaccurate
--
___
P
Steven D'Aprano added the comment:
Sorry Nathan, I worded my first response awkwardly, of course mathematically we
should expect a result of 1j, by why do you expect it in a floating point
calculation? Do you have an alternative?
(I promise this is my last comment until you have
Steven D'Aprano added the comment:
> There isn't any mention of variables. While not operators, probably worth
> mentioning that they (effectively?) have higher precedence than any of the
> operators.
I'm sorry, I don't understand what that means.
---
Steven D'Aprano added the comment:
Hi John, you said:
> it seems that sorted built-in always return floats before int if they appear
> to be equal
But that's not correct:
>>> sorted([5.0, 5])
[5.0, 5]
>>> sorted([5, 5.0])
[5, 5.0]
Python's sort is
Steven D'Aprano added the comment:
I concur with Eric that this should be closed.
They're not "incorrect results", they are correct results, or at least *better*
results. We did not invent the so-called Banker's Rounding technique, it has
been the standard used by
New submission from Steven D'Aprano :
You have a bug in your code.
This is a bug tracker for bugs in Python, not a help desk for solving errors in
your own code. In this case, the problem is that you have created a file called
"turtle.py" which is shadowing the original turtle
Steven D'Aprano added the comment:
I'm closing this as "Works for me".
rafihassan190041234, if you still think it is a bug in the language, rather
than a bug in your code or a mistake in your understanding, you can re-open
this with more details. As Zach already comment
Steven D'Aprano added the comment:
This is not a bug fix, it is a change of behaviour ("enhancement"). All of 3.6
through 3.9 are in feature freeze. 3.10 is probably in feature freeze, but if
not it is extremely close to it. So this can only go into 3.11 and (maybe) 3.10.
Bu
Steven D'Aprano added the comment:
I believe that this may be the same issue as this thread
https://mail.python.org/archives/list/python-...@python.org/thread/35NECLGFIVAHWTIPAYDBJOJJX3FSY233/
in particular this comment:
https://mail.python.org/archives/list/python-...@python.org/me
Steven D'Aprano added the comment:
This is a behaviour change not a simple bug fix. 3.6 through 3.9 are all in
feature-freeze, and we're days away from the same for 3.10.
Not that I don't believe you about the _netrc convention on Windows, but do you
have a link to a
Steven D'Aprano added the comment:
> loading the entire game or DNN (from STDIN) can be simply put into one line
> as `locals().update(eval(sys.stdin.read()))`
This is how you get command injection attacks.
https://owasp.org/www-community/attacks/Command_Injection
https://cw
Steven D'Aprano added the comment:
This is not a bug. It is *literally correct* that the int 9007199254740993 is
not equal to the float 9007199254740992.0 so I really don't know why you would
desire a different result. If you want to compare two floats, compare two
floats, not an
Steven D'Aprano added the comment:
I doubt it is a memory issue. Tell us what investigation you did that lead you
to that conclusion.
Python code doesn't normally just stop working for no reason. I expect that you
changed your code in some way and introduced a bug.
This is not a
Steven D'Aprano added the comment:
On Sun, May 09, 2021 at 10:04:29PM +, Mohamed wrote:
> As I mentioned, It seems that the recent update of Windows has affected
> Tkinter,
> so that mainloop is not working after the first time
That isn't what it looks like to me.
Steven D'Aprano added the comment:
On Sun, May 09, 2021 at 11:55:56PM +, Mohamed wrote:
> Please find attached, the demo with dummy data. As I mentioned, it was
> working fine until May 1st.
If it was working fine until May 1st, I would start my investigation by
look
Steven D'Aprano added the comment:
I agree with you that "regressor" is too obscure and should be changed.
I disagree about the "y = mx + c". Haven't we already discussed this? That form
is used in linear algebra, but not used in statistics. Quoting from Yale:
Steven D'Aprano added the comment:
> The named tuple should be called Line because that is what it describes.
> Also, a Line class would be reusuable for other purposes that linear
> regression.
I think that most people would expect that a Line class would represent a
straig
Steven D'Aprano added the comment:
> The ML world has collapsed on the terms X and y. (With that
> capitalization).
I just googled for "ML linear regression" and there is no consistency in
either the variable used or the parameters. But most seem to use
lowercase x,y. O
Steven D'Aprano added the comment:
This is not a bug, this is working as the language is designed, and the
behaviour occurs for all functions, not just class methods. Default values are
only evaluated once, when the function is defined, not every time the function
is called.
This is
Steven D'Aprano added the comment:
The smiley emoji ๐ is U+1F600 which is outside of the Unicode Basic
Multilingual Plane (BMP). IDLE's underlying graphical toolkit, Tcl/Tk, has
problems with Unicode characters outside of the BMP, so this may not be fixable
by us.
If all you
Steven D'Aprano added the comment:
Correct, sys has no attribute 'original_stdout'.
Do you have a file called `sys.py`? Rename it.
--
nosy: +steven.daprano
___
Python tracker
<https://bugs.pyt
Change by Steven D'Aprano :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.pyth
Steven D'Aprano added the comment:
match-case has not even reached a stable version of Python yet, it is only
available in Python 3.10 which is still in beta. Are we sure that it is faster
in all cases and how do you know it is more intuitive when the vast majority of
Python users
Steven D'Aprano added the comment:
How did you do the timing?
--
___
Python tracker
<https://bugs.python.org/issue44276>
___
___
Python-bugs-list m
Steven D'Aprano added the comment:
I think you have missed something important here:
>>> data = b'foo\bar'
>>> len(data)
6
>>> print(data)
b'foo\x08ar'
If you want bytes including a backslash followed by a b, you need t
Steven D'Aprano added the comment:
Remember that backslash escapes are only a Python syntactic feature. If you
read data from a file, or from the input() builtin, that contains a backslash,
it remains a backslash:
>>> s = input()
a\b
>>> print(len(s),
Steven D'Aprano added the comment:
This is not a bug, it is intentional design and has been since Python 1.
You are incorrect about x consuming memory "always". If the value bound to x is
in use elsewhere, deleting x will save no memory. If the value is not in use
elsewh
Steven D'Aprano added the comment:
By the way, loop variables are not considered to be "temporary" in Python. They
are no more temporary than any other local variable -- they *are* local
variables with exactly the same scope and lifetime as all other
Steven D'Aprano added the comment:
`match` is a soft keyword. Which means that the interpreter should still
recognise `match 'str': ...` even if the *name* "match" is defined.
--
nosy: +steven.daprano
___
Python tracker
New submission from Steven D'Aprano :
Format strings should allow spaces around keys and indices. This might be as
simple as running str.strip() on the contents of curly braces?
Aside from indentation and newlines, in most other contexts whitespace is
insignificant. E.g. in subscripting
Change by Steven D'Aprano :
--
nosy: +steven.daprano
___
Python tracker
<https://bugs.python.org/issue44339>
___
___
Python-bugs-list mailing list
Unsubscr
Change by Steven D'Aprano :
--
nosy: +steven.daprano
___
Python tracker
<https://bugs.python.org/issue44344>
___
___
Python-bugs-list mailing list
Unsubscr
Steven D'Aprano added the comment:
I agree that we cannot make the syntax of format string identifal to
f-strings. F-strings support arbitrary expressions, while format strings
support only a small subset of possible identifiers.
My comment was not to make format strings identical
Change by Steven D'Aprano :
--
nosy: +steven.daprano
___
Python tracker
<https://bugs.python.org/issue44370>
___
___
Python-bugs-list mailing list
Unsubscr
Steven D'Aprano added the comment:
math.ieee754_total_order sounds good to me, but how would you get the minimum?
Wikipedia doesn't have much on the 2019 revision to IEEE-754 except to say that
the min/max rules have been overhauled again, but without giving much deta
New submission from Steven D'Aprano :
Naively, I assumed that `x**2` would be faster than `x*x` as there is only one
name lookup in the first, and two in the second. But it is slower.
The performance of `x**2` relative to `x*x` has gradually deteriorated compared
to `x*x` over many ver
Steven D'Aprano added the comment:
Not every one line expression needs to be a function in a library.
`bool(getrandbits(1))` is self-explanatory enough, and it is doubtful that any
implementation would be faster.
Using getrandbits(1) to return 0 or 1 is fine; if you need a bool, call
Change by Steven D'Aprano :
--
nosy: +steven.daprano
versions: +Python 3.11
___
Python tracker
<https://bugs.python.org/issue44405>
___
___
Python-bugs-l
Steven D'Aprano added the comment:
Also please read this:
https://docs.python.org/3/faq/design.html#why-are-floating-point-calculations-so-inaccurate
--
nosy: +steven.daprano
___
Python tracker
<https://bugs.python.org/is
Steven D'Aprano added the comment:
Hi Christian,
For future reference, here are some good guidelines for submitting bug reports
and asking for help to debug your code:
https://stackoverflow.com/help/minimal-reproducible-example
http://www.sscce.org/
--
nosy: +steven.da
Steven D'Aprano added the comment:
Are you referring to this?
https://docs.python.org/3/library/tkinter.html
I acknowledge that there are legitimate criticism of the tkinter docs, and its
weaknesses, but you overstate your case.
- Tutorials are documentation, they just aren't
Change by Steven D'Aprano :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.pyth
Steven D'Aprano added the comment:
Dennis is correct: these are working as attended, you have just misunderstood
what they are supposed to do.
--
nosy: +steven.daprano
resolution: -> not a bug
stage: -> resolved
status: open -> closed
Steven D'Aprano added the comment:
This is not a bug. Assignment in Python does not make a copy, it creates a
second name for the same object.
--
nosy: +steven.daprano
resolution: -> not a bug
stage: -> resolved
status: open -> closed
New submission from Steven Hsu :
In https://github.com/python/cpython/blob/main/Doc/distributing/index.rst,
there are three expired hyperlinks:
.. _Project structure: \
https://packaging.python.org/tutorials/distributing-packages/
.. _Building and packaging the project: \
https
Change by Steven Hsu :
--
keywords: +patch
pull_requests: +25586
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/27027
___
Python tracker
<https://bugs.python.org/issu
Change by Steven Hsu :
--
pull_requests: +25592
pull_request: https://github.com/python/cpython/pull/27032
___
Python tracker
<https://bugs.python.org/issue44
Steven Hsu added the comment:
I have make a new PR (#27032), and the CLA was signed.
Thanks for review.
--
versions: -Python 3.9
___
Python tracker
<https://bugs.python.org/issue44
Steven D'Aprano added the comment:
Not a bug, the result is correct.
Python floats are binary floating point values, not decimal. 0.3368655's actual
value is exactly:
0.3368654984392928809029399417340755462646484375
so when rounding to six decimal places, the seventh dec
Steven D'Aprano added the comment:
I strongly oppose this change. Merely printing an object should not have a
side-effect of this magnitude. Standard Python behaviour is that an object's
repr should return a useful string, not exit the interpreter.
This is a backwards-incompati
Steven D'Aprano added the comment:
This is a backwards-incompatible change, at the very least it needs an okay
from the core devs (and possibly even a PEP) not just a patch.
Stargirl Flowers suggested:
> we could ask the user to confirm that they want to exit
Please, no, that is
Steven D'Aprano added the comment:
Please don't do this.
On Mon, Jul 12, 2021 at 02:19:58PM +, Pablo Galindo Salgado wrote:
> >>> exit
> bye!
This is a user-hostile and unfriendly UI for Python. The Python REPL is
not a shell like bash etc, it should be saf
Steven D'Aprano added the comment:
> Other than that, only arguments based on the purity of the language,
> but I think having this working is far more important.
Having this "working" is not important at all. This is precisely the
sort of user-hostile anti-feature that
Steven D'Aprano added the comment:
numpy is a third-party library, you will have to report it to them, we can't do
anything about it.
--
nosy: +steven.daprano
resolution: -> third party
stage: -> resolved
status: open -> closed
___
Steven D'Aprano added the comment:
On Tue, Jul 13, 2021 at 01:58:30AM +, Taylor Alexander wrote:
> I would push back against the idea that this is about laziness. It
> sounds like this is about reducing user confusion.
Users aren't *confused* by the instructions, whi
Steven D'Aprano added the comment:
On Wed, Jul 14, 2021 at 08:10:51PM +, Aaron Meurer wrote:
> There are already pseudo-keywords in the language, in particular,
> super()
super is not a pseudo-keyword. It's a regular builtin object that
interacts with some (quite clever
Steven D'Aprano added the comment:
Isn't `__builtins__` a private CPython feature? Other implementations may not
have it or use it, and it is my understanding that we should not touch it.
--
nosy: +steven.daprano
___
Python track
Steven D'Aprano added the comment:
On Thu, Jul 15, 2021 at 10:24:34AM +, Patrick Reader wrote:
> It may be, but in that case, why do LOAD_BUILD_CLASS and things still use it?
They're allowed to use CPython implementation details because they are
part of the CPython i
New submission from Steven Hsu :
In Doc/glossary.rst, the definition about "coercion" is as below:
"The implicit conversion of an instance of one type to another during an
operation which involves two arguments of the same type."
However, in the example following this
Steven Hsu added the comment:
Thanks for your reply and suggestion.
I can totally understand your explanation about the definition of coercion.
In conclusion, I think this glossary entry may need some modification for
better understanding, or simply be deleted.
So what's the next
Change by Steven Hsu :
--
keywords: +patch
pull_requests: +25767
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/27226
___
Python tracker
<https://bugs.python.org/issu
Steven Hsu added the comment:
Thanks for reminding.
In the beginning, I didn't add a NEWS entry in the PR (#27032).
However, after 11 days when there was no progress of the PR, I doubted that
maybe I missed something, so I made a NEWS entry to make sure.
And soon after the NEWS entr
Steven D'Aprano added the comment:
Jack, Thereisfood is using Windows, which I understand has a clock with
millisecond accuracy. So a sleep of a millisecond should, I think, work on
Windows even if it doesn't work on Linux.
Could a Windows expert clarify please?
-
Steven D'Aprano added the comment:
args.seed if args.seed else SEED is not doing what you think it is doing.
SEED is an *int* but args.seed is a *str*:
>>> random.seed(6385845682483836956)
>>> random.randint(10, 500)
92
>>> random.seed('6385845682483836
Steven D'Aprano added the comment:
Not a bug, this is due to operator precedence.
It is documented under the power operator:
https://docs.python.org/3/reference/expressions.html#the-power-operator
and in the operator precedence table:
https://docs.python.org/3/reference/expressions
New submission from Steven Hsu :
In Doc/glossary.rst, the first sentence of the entry "__future__" is that "A
pseudo-module which programmers can use to enable new language features which
are not compatible with the current interpreter."
However, in Doc/library/__fut
Steven D'Aprano added the comment:
I agree that the contradiction should be resolved.
There is an actual `__future__.py` module, which on my system it is at
/usr/local/lib/python3.9/__future__.py
But when we use the special syntax:
from __future__ import
it doesn't do a nor
Steven D'Aprano added the comment:
Python 2.0.1 is 20 years old and not supported.
I don't think that installing Python on Windows 3.1 has ever been supported.
But even if it was, we're certainly not supporting it now.
--
nosy: +steven.daprano
resolution: -&
301 - 400 of 1942 matches
Mail list logo