[issue38458] lists

2019-10-12 Thread Steven D'Aprano
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

[issue38458] lists

2019-10-12 Thread Steven D'Aprano
Change by Steven D'Aprano : -- nosy: +pablogsal ___ Python tracker <https://bugs.python.org/issue38458> ___ ___ Python-bugs-list mailing list Unsubscr

[issue38475] Break Statement

2019-10-14 Thread Steven D'Aprano
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

[issue38490] statistics: add covariance and Pearson's correlation

2019-10-16 Thread Steven D'Aprano
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

[issue38496] Python3 allows mixture of tabs and spaces for indentation

2019-10-16 Thread Steven D'Aprano
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

[issue38512] bug of the v3.7 API document demo case code

2019-10-18 Thread Steven D'Aprano
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

[issue38516] PEP 3132 -- Extended Iterable Unpacking inconsistent assignment of * variable

2019-10-18 Thread Steven D'Aprano
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

[issue38307] Provide Class' end line in pyclbr module

2019-10-18 Thread Steven D'Aprano
Change by Steven D'Aprano : -- title: Provide Class' end line in readmodule module -> Provide Class' end line in pyclbr module ___ Python tracker <https://bugs.

[issue38524] functools.cached_property is not supported for setattr

2019-10-19 Thread Steven D'Aprano
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

[issue38556] Walrus operator in list comprehensions [Python 3.8.0]

2019-10-22 Thread Steven D'Aprano
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&#x

[issue38556] Walrus operator in list comprehensions [Python 3.8.0]

2019-10-22 Thread Steven D'Aprano
Change by Steven D'Aprano : -- components: +Interpreter Core type: enhancement -> behavior ___ Python tracker <https://bugs.python.org/issue38556> ___ _

[issue38606] Function to count total number of common divisors of two numbers

2019-10-27 Thread Steven D'Aprano
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 &

[issue38612] some non-ascii charcters link to same identifier/data

2019-10-28 Thread Steven D'Aprano
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)

[issue38612] some non-ascii charcters link to same identifier/data

2019-10-28 Thread Steven D'Aprano
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:

[issue38637] fix GROWTH_RATE comments bug

2019-10-29 Thread Steven D'Aprano
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

[issue38382] statistics.harmonic_mean fails to raise error with negative input that follows a 0

2019-10-29 Thread Steven D'Aprano
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

[issue38382] statistics.harmonic_mean fails to raise error with negative input that follows a 0

2019-10-30 Thread Steven D'Aprano
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

[issue38654] `urllib.request.Request` uses mutable value as default value

2019-10-31 Thread Steven D'Aprano
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

[issue38654] `urllib.request.Request` uses mutable value as default value

2019-11-01 Thread Steven D'Aprano
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

[issue38703] should we expect round(0.95, 1) to be 1.0, instead of 0.9?

2019-11-05 Thread Steven D'Aprano
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

[issue38706] What should the error message in the exception raised by assertTrue and assertFalse be?

2019-11-05 Thread Steven D'Aprano
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

[issue38706] What should the error message in the exception raised by assertTrue and assertFalse be?

2019-11-05 Thread Steven D'Aprano
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

[issue38706] What should the error message in the exception raised by assertTrue and assertFalse be?

2019-11-06 Thread Steven D'Aprano
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

[issue38740] Line count mis match between open() vs sys.stdin api calls

2019-11-08 Thread Steven D'Aprano
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

[issue43489] Can't install, nothing to install

2021-03-13 Thread Steven D'Aprano
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

[issue43519] access python private variable

2021-03-16 Thread Steven D'Aprano
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

[issue43516] python on raspberry pi

2021-03-16 Thread Steven D'Aprano
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

[issue43589] Using defaultdict as kwarg to function reuses same dictionary every function call

2021-03-22 Thread Steven D'Aprano
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

[issue43737] Documentation of modulo operator should document behaviour clearly when second operator is negative

2021-04-05 Thread Steven D'Aprano
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

[issue43786] slice(None) is slice(None) is False

2021-04-09 Thread Steven D'Aprano
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

[issue43801] Carriage Return problem in version v3.9.0:9cf6752

2021-04-10 Thread Steven D'Aprano
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(

[issue43830] (-1) ** 0.5 returns (6.123233995736766e-17+1j) instead of 1j

2021-04-13 Thread Steven D'Aprano
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

[issue43830] (-1) ** 0.5 returns (6.123233995736766e-17+1j) instead of 1j

2021-04-13 Thread Steven D'Aprano
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

[issue43830] (-1) ** 0.5 returns (6.123233995736766e-17+1j) instead of 1j

2021-04-13 Thread Steven D'Aprano
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

[issue43837] Operator precedence documentation could be more clear

2021-04-14 Thread Steven D'Aprano
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. ---

[issue43887] it seems that sorted built-in always return floats before int if they appear to be equal

2021-04-19 Thread Steven D'Aprano
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

[issue43903] round() produces incorrect results with certain values

2021-04-21 Thread Steven D'Aprano
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

[issue43906] turtle graphics don't work

2021-04-21 Thread Steven D'Aprano
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

[issue43924] print unexpected values in infinite loop

2021-04-23 Thread Steven D'Aprano
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

[issue43929] Raise on threading.Event.__bool__ due to ambiguous nature

2021-04-24 Thread Steven D'Aprano
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

[issue43940] int casting to float results to a different value in memory

2021-04-25 Thread Steven D'Aprano
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

[issue43980] netrc module looks for .netrc even on Windows where the convention is _netrc

2021-04-29 Thread Steven D'Aprano
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

[issue44028] Request for locals().update() to work, it is

2021-05-04 Thread Steven D'Aprano
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

[issue44054] 2**53+1 != float(2**53+1)

2021-05-06 Thread Steven D'Aprano
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

[issue44076] issue with list in Python 3.8.5

2021-05-08 Thread Steven D'Aprano
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

[issue44076] issue with list in Python 3.8.5

2021-05-09 Thread Steven D'Aprano
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.

[issue44076] issue with list in Python 3.8.5

2021-05-09 Thread Steven D'Aprano
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

[issue44151] Improve parameter names and return value ordering for linear_regression

2021-05-16 Thread Steven D'Aprano
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:

[issue44151] Improve parameter names and return value ordering for linear_regression

2021-05-16 Thread Steven D'Aprano
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

[issue44151] Improve parameter names and return value ordering for linear_regression

2021-05-17 Thread Steven D'Aprano
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

[issue44216] Bug in class method with optional parameter

2021-05-23 Thread Steven D'Aprano
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

[issue44217] [IDLE] Weird behaviour in IDLE while dealing with non-ASCII characters

2021-05-23 Thread Steven D'Aprano
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

[issue44266] AttributeError: module 'sys' has no attribute 'original_stdout'

2021-05-29 Thread Steven D'Aprano
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

[issue44272] DeprecationWarning: The *random* parameter to shuffle() has been deprecated since Python 3.9 and will be removed in a subsequent version

2021-05-31 Thread Steven D'Aprano
Change by Steven D'Aprano : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.pyth

[issue44276] Replace if-elif-else structure with match-case (PEP634)

2021-06-01 Thread Steven D'Aprano
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

[issue44276] Replace if-elif-else structure with match-case (PEP634)

2021-06-02 Thread Steven D'Aprano
Steven D'Aprano added the comment: How did you do the timing? -- ___ Python tracker <https://bugs.python.org/issue44276> ___ ___ Python-bugs-list m

[issue44308] Raw Strings lack parody

2021-06-03 Thread Steven D'Aprano
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

[issue44308] Raw Strings lack parody

2021-06-03 Thread Steven D'Aprano
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),

[issue44332] For Loop temporary variable scope should be local to For loop

2021-06-06 Thread Steven D'Aprano
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

[issue44332] For Loop temporary variable scope should be local to For loop

2021-06-06 Thread Steven D'Aprano
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

[issue44341] Conflict between re.match and match keyword

2021-06-07 Thread Steven D'Aprano
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

[issue44355] Allow spaces in format strings

2021-06-08 Thread Steven D'Aprano
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

[issue44339] Discrepancy between math.pow(0.0, -inf) and 0.0**-inf

2021-06-09 Thread Steven D'Aprano
Change by Steven D'Aprano : -- nosy: +steven.daprano ___ Python tracker <https://bugs.python.org/issue44339> ___ ___ Python-bugs-list mailing list Unsubscr

[issue44344] Documentation for pow() should include the possibility of complex numbers as a return type

2021-06-09 Thread Steven D'Aprano
Change by Steven D'Aprano : -- nosy: +steven.daprano ___ Python tracker <https://bugs.python.org/issue44344> ___ ___ Python-bugs-list mailing list Unsubscr

[issue44355] Allow spaces in format strings

2021-06-09 Thread Steven D'Aprano
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

[issue44370] Inconsistent results for min() and max() with math.nan as argument

2021-06-10 Thread Steven D'Aprano
Change by Steven D'Aprano : -- nosy: +steven.daprano ___ Python tracker <https://bugs.python.org/issue44370> ___ ___ Python-bugs-list mailing list Unsubscr

[issue44370] Inconsistent results for min() and max() with math.nan as argument

2021-06-10 Thread Steven D'Aprano
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

[issue44376] Improve performance of integer exponentiation

2021-06-10 Thread Steven D'Aprano
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

[issue44400] Propose random.randbool()

2021-06-11 Thread Steven D'Aprano
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

[issue44405] add program passed as string to dis module.

2021-06-12 Thread Steven D'Aprano
Change by Steven D'Aprano : -- nosy: +steven.daprano versions: +Python 3.11 ___ Python tracker <https://bugs.python.org/issue44405> ___ ___ Python-bugs-l

[issue44419] Wrong division calculation for numbers more than 16 digits

2021-06-14 Thread Steven D'Aprano
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

[issue44421] random.uniform() hangs will eating up all available RAM

2021-06-14 Thread Steven D'Aprano
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

[issue44485] TKinter docs page does not provide actual documentation

2021-06-22 Thread Steven D'Aprano
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

[issue44507] Favor needed ASAP

2021-06-24 Thread Steven D'Aprano
Change by Steven D'Aprano : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.pyth

[issue44513] for string methods strip, lstrip, rstrip, when param is a string which has more than one char, those methods is no useful currently

2021-06-25 Thread Steven D'Aprano
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

[issue44557] It's a bug? Dict

2021-07-03 Thread Steven D'Aprano
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

[issue44561] Some expired hyperlinks in Python documentation

2021-07-04 Thread Steven Hsu
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

[issue44561] Some expired hyperlinks in Python documentation

2021-07-04 Thread Steven Hsu
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

[issue44561] Some expired hyperlinks in Python documentation

2021-07-05 Thread Steven Hsu
Change by Steven Hsu : -- pull_requests: +25592 pull_request: https://github.com/python/cpython/pull/27032 ___ Python tracker <https://bugs.python.org/issue44

[issue44561] Some expired hyperlinks in Python documentation

2021-07-07 Thread Steven Hsu
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

[issue44595] round() gives wrong result

2021-07-09 Thread Steven D'Aprano
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

[issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit()

2021-07-12 Thread Steven D'Aprano
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

[issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit()

2021-07-12 Thread Steven D'Aprano
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

[issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit()

2021-07-12 Thread Steven D'Aprano
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

[issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit()

2021-07-12 Thread Steven D'Aprano
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

[issue44619] Bug in Python 3.7.10

2021-07-13 Thread Steven D'Aprano
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 ___

[issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit()

2021-07-13 Thread Steven D'Aprano
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

[issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit()

2021-07-14 Thread Steven D'Aprano
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

[issue44643] importing does not dispatch to __builtins__.__getitem__ to lookup __import__

2021-07-15 Thread Steven D'Aprano
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

[issue44643] importing does not dispatch to __builtins__.__getitem__ to lookup __import__

2021-07-15 Thread Steven D'Aprano
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

[issue44651] An unclear definition in Doc/glossary.rst

2021-07-15 Thread Steven Hsu
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

[issue44651] An unclear definition in Doc/glossary.rst

2021-07-16 Thread Steven Hsu
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

[issue44651] An unclear definition in Doc/glossary.rst

2021-07-18 Thread Steven Hsu
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

[issue44561] Some expired hyperlinks in Python documentation

2021-07-18 Thread Steven Hsu
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

[issue44681] time.sleep(0.001) not working properly

2021-07-19 Thread Steven D'Aprano
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? -

[issue44691] bug in interactions between argparse and random

2021-07-20 Thread Steven D'Aprano
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

[issue44692] Const folding in parser with negative numbers doesn't match float/int behaviour

2021-07-20 Thread Steven D'Aprano
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

[issue44693] Unclear definition of the "__future__" module in Docs

2021-07-21 Thread Steven Hsu
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

[issue44693] Unclear definition of the "__future__" module in Docs

2021-07-21 Thread Steven D'Aprano
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

[issue44696] Python 2.0.1 Installation:

2021-07-21 Thread Steven D'Aprano
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: -&

<    1   2   3   4   5   6   7   8   9   10   >