[issue41598] rnd() + rndup() in math

2020-08-21 Thread Steven D'Aprano
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

[issue41616] Global variable in whole project and Relative imports problem

2020-08-22 Thread Steven D'Aprano
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

[issue41598] Adding support for rounding modes to builtin round

2020-08-24 Thread Steven D'Aprano
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

[issue41645] Typo First Page of Documentation

2020-08-26 Thread Steven D'Aprano
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&#x

[issue41656] Sets are storing elements in sorted order.

2020-08-28 Thread Steven D'Aprano
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', &

[issue41656] Sets are storing elements in sorted order.

2020-08-28 Thread Steven D'Aprano
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

[issue41666] fix

2020-08-30 Thread Steven D'Aprano
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

[issue41716] SyntaxError: EOL while scanning string literal

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

[issue41716] SyntaxError: EOL while scanning string literal

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

[issue41719] Why does not range() support decimals?

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

[issue41740] Improve error message for string concatenation via `sum`

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

[issue41740] Improve error message for string concatenation via `sum`

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

[issue41743] Remove Unnecessarily Gendered Language from the Documentation

2020-09-08 Thread Steven D'Aprano
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

[issue41743] Remove Unnecessarily Gendered Language from the Documentation

2020-09-08 Thread Steven D'Aprano
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

[issue41770] Import module doesn't updated

2020-09-11 Thread Steven D'Aprano
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

[issue41774] While removing element from list using for and remove(), which has same items output is not right

2020-09-12 Thread Steven D'Aprano
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

[issue41774] While removing element from list using for and remove(), which has same items output is not right

2020-09-12 Thread Steven D'Aprano
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

[issue41788] enhancement: add assertDuration context manager to unittest module

2020-09-15 Thread Steven D'Aprano
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

[issue41904] datetime.datetime.today makes no sense and should be removed

2020-10-01 Thread Steven D'Aprano
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

[issue41904] datetime.datetime.today makes no sense and should be removed

2020-10-01 Thread Steven D'Aprano
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

[issue41920] Weird add operation of "0.2222 + 0.1111"

2020-10-03 Thread Steven D'Aprano
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

[issue41920] Weird add operation of "0.2222 + 0.1111"

2020-10-03 Thread Steven D'Aprano
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

[issue41920] Weird add operation of "0.2222 + 0.1111"

2020-10-03 Thread Steven D'Aprano
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

[issue41927] Why is there no documentation in Russian?

2020-10-04 Thread Steven D'Aprano
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:

python-bugs-list@python.org

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

[issue42003] After changing to list or tuple, will the original parameter change?

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

[issue41904] datetime.datetime.today makes no sense and should be removed

2020-10-13 Thread Steven D'Aprano
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

[issue42074] setup error on windows

2020-10-18 Thread Steven D'Aprano
Change by Steven D'Aprano : -- title: f***ing setup failed is driving me insane -> setup error on windows ___ Python tracker <https://bugs.python.org

[issue42074] setup error on windows

2020-10-18 Thread Steven D'Aprano
Change by Steven D'Aprano : -- components: +Installation -Unicode type: crash -> behavior ___ Python tracker <https://bugs.python.org/issue42074> ___ _

[issue42074] setup error on windows

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

[issue42075] Verbose/confusing default format on warnings

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

[issue42148] floating point representation issues

2020-10-25 Thread Steven D'Aprano
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

[issue42148] floating point representation issues

2020-10-25 Thread Steven D'Aprano
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

[issue42203] Unexpected behaviour NameError: name 'open' is not defined

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

[issue42223] List repetition operator gives unexpected results

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

[issue42227] Unexpected sharing of list/set/dict between instances of the same class, when the list/set/dict is a default parameter value of the constructor

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

[issue42227] Unexpected sharing of list/set/dict between instances of the same class, when the list/set/dict is a default parameter value of the constructor

2020-10-31 Thread Steven D'Aprano
Steven D'Aprano added the comment: See also my comment here: https://bugs.python.org/msg361451 -- ___ Python tracker <https://bugs.python.org/is

[issue42265] Remove binhex module following PEP-594

2020-11-04 Thread Steven D'Aprano
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,

[issue42290] Unicode inconsistent display after concencated

2020-11-07 Thread Steven D'Aprano
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

[issue42302] [Turtle] Add clockwise and anticlockwise method as alias to right and left

2020-11-09 Thread Steven D'Aprano
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

[issue42302] [Turtle] Add clockwise and anticlockwise method as alias to right and left

2020-11-10 Thread Steven D'Aprano
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

[issue42310] for loop creates element in defaultdict

2020-11-10 Thread Steven D'Aprano
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

[issue42379] Optional List Args Persist Across Objects

2020-11-16 Thread Steven D'Aprano
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

[issue42394] Exception handling on boolean comparisons

2020-11-17 Thread Steven D'Aprano
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] ==

[issue42421] Native open failed to create a file on windows10 when colon exists in the name

2020-11-20 Thread Steven D'Aprano
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

[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

2020-11-21 Thread Steven D'Aprano
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

[issue42439] Use of ternary operator instead of if and else in month calculation function

2020-11-22 Thread Steven D'Aprano
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

[issue42441] UnicodeEncodeError

2020-11-23 Thread Steven D'Aprano
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

[issue42459] Wrong Output

2020-11-25 Thread Steven D'Aprano
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

[issue42460] Wrong Output

2020-11-25 Thread Steven D'Aprano
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)

[issue6210] Exception Chaining missing method for suppressing context

2012-01-26 Thread Steven D'Aprano
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

[issue6210] Exception Chaining missing method for suppressing context

2012-01-26 Thread Steven D'Aprano
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

[issue6210] Exception Chaining missing method for suppressing context

2012-01-29 Thread Steven D'Aprano
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.

[issue14361] No link to issue tracker on Python home page

2012-03-18 Thread Steven D'Aprano
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.

[issue14362] No mention of collections.ChainMap in What's New for 3.3

2012-03-18 Thread Steven D'Aprano
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

[issue14363] Can't build Python 3.3a1 on Centos 5

2012-03-18 Thread Steven D'Aprano
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

[issue14361] No link to issue tracker on Python home page

2012-03-18 Thread Steven D'Aprano
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 >

[issue14361] No link to issue tracker on Python home page

2012-03-18 Thread Steven D'Aprano
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

[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

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

[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

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

[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

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

[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

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

[issue36980] pass-by-reference clues

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

[issue36461] timeit: Additional changes for autorange

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

[issue36461] timeit: Additional changes for autorange

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

[issue36461] timeit: Additional changes for autorange

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

[issue36461] timeit: Additional changes for autorange

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

[issue37061] The strangest glitch I have ever seen - incorrect indenterror, even on commented out code.

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

[issue37061] The strangest glitch I have ever seen - incorrect indenterror, even on commented out code.

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

[issue36461] timeit: Additional changes for autorange

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

[issue36461] timeit: Additional changes for autorange

2019-06-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: > ``if number is None or number < 0`` Sorry, that should be number == 0 -- ___ Python tracker <https://bugs.python.

[issue37131] all(range()...)) is needlessley slow

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

[issue37131] all(range()...)) is needlessley slow

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

[issue35431] Add a function for computing binomial coefficients to the math module

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

[issue37161] Pre-populate user editable text in input()

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

[issue37158] Speed-up statistics.fmean()

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

[issue32884] Adding the ability for getpass to print asterisks when passowrd is typed

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

[issue37176] super() docs don't say what super() does

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

[issue37176] super() docs don't say what super() does

2019-06-06 Thread Steven D'Aprano
Change by Steven D'Aprano : -- Removed message: https://bugs.python.org/msg344892 ___ Python tracker <https://bugs.python.org/issue37176> ___ ___ Pytho

[issue37176] super() docs don't say what super() does

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

[issue37176] super() docs don't say what super() does

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

[issue37176] super() docs don't say what super() does

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

[issue37176] super() docs don't say what super() does

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

[issue37192] pip instal math3d - EROR

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

[issue37176] super() docs don't say what super() does

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

[issue37176] super() docs don't say what super() does

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

[issue37176] super() docs don't say what super() does

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

[issue34850] Emit a syntax warning for "is" with a literal

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

[issue34850] Emit a syntax warning for "is" with a literal

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

[issue37273] from pickle import rick

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

[issue37304] compiler need support in(de)crement operation or all of it should have syntax error.

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

[issue37306] "~/" not working with open() function in posix systems

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

[issue37377] unicode error should raise a value error

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

[issue37379] Provide triggering AttributeError exception to __getattr__ for reraising

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

[issue37466] Move casting prompt after its validation in _raw_input()

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

[issue37454] Clarify docs for math.log1p()

2019-07-01 Thread Steven D'Aprano
Change by Steven D'Aprano : -- nosy: +steven.daprano ___ Python tracker <https://bugs.python.org/issue37454> ___ ___ Python-bugs-list mailing list Unsubscr

[issue37490] poor documentation for .startswith, .endswith

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

[issue37490] poor documentation for .startswith, .endswith

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

[issue37506] os.mkdir creates invalid folder when path string has trailing space and slash

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

[issue37512] Error in the documentation about string concatenation

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

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