[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

[issue41952] Extra Space Between "Oct" and "5"

2020-10-05 Thread Steven Yan
Change by Steven Yan : -- assignee: terry.reedy components: IDLE nosy: sy, terry.reedy priority: normal severity: normal status: open title: Extra Space Between "Oct" and "5" type: enhancement versions: Python 3.9 ___ Py

[issue41952] Top Sentence Had a Extra Space Between "Oct" and "5"

2020-10-05 Thread Steven Yan
Change by Steven Yan : -- title: Extra Space Between "Oct" and "5" -> Top Sentence Had a Extra Space Between "Oct" and "5" ___ Python t

[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

[issue42204] "import setuptools" Results in "ModuleNotFoundError: No module named '_distutils_hack'"

2020-10-30 Thread Steven Yan
Change by Steven Yan : -- components: Distutils files: pic.png nosy: dstufft, eric.araujo, sy priority: normal severity: normal status: open title: "import setuptools" Results in "ModuleNotFoundError: No module named '_distutils_hack'" type: behavior v

[issue42204] "import setuptools" Results in "ModuleNotFoundError: No module named '_distutils_hack'"

2020-10-30 Thread Steven Yan
Change by Steven Yan : Added file: https://bugs.python.org/file49551/pic.png ___ Python tracker <https://bugs.python.org/issue42204> ___ ___ Python-bugs-list mailin

[issue42204] "import setuptools" Results in "ModuleNotFoundError: No module named '_distutils_hack'"

2020-10-30 Thread Steven Yan
Change by Steven Yan : Removed file: https://bugs.python.org/file49550/pic.png ___ Python tracker <https://bugs.python.org/issue42204> ___ ___ Python-bugs-list mailin

[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)

[issue13850] Summary tables for argparse add_argument options

2012-01-24 Thread Steven Bethard
Steven Bethard added the comment: Sounds like an excellent plan to me too. -- ___ Python tracker <http://bugs.python.org/issue13850> ___ ___ Python-bugs-list m

[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

[issue13879] Argparse does not support subparser aliases in 2.7

2012-01-27 Thread Steven Bethard
Steven Bethard added the comment: This is a new feature, not a bug, so I think the correct fix is to change the 2.7 documentation, since at this point 2.7 can only get bugfixes, not new features. -- ___ Python tracker <http://bugs.python.

[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.

[issue13966] Add disable_interspersed_args() to argparse.ArgumentParser

2012-02-10 Thread Steven Bethard
Steven Bethard added the comment: The idea and patch seem okay to me. Needs tests though. -- ___ Python tracker <http://bugs.python.org/issue13966> ___ ___ Pytho

[issue13922] argparse handling multiple "--" in args improperly

2012-02-13 Thread Steven Bethard
Steven Bethard added the comment: See nargs=argparse.REMAINDER for an approach that doesn't require that first '--': http://docs.python.org/library/argparse.html#nargs But yeah, removing more than one '--' is probably a bug. Fixing it would be a little backwards i

[issue9253] argparse: optional subparsers

2012-02-20 Thread Steven Bethard
Steven Bethard added the comment: The implementation looks along the right track. Now it just needs some tests. -- ___ Python tracker <http://bugs.python.org/issue9

[issue14034] Add argparse howto

2012-02-21 Thread Steven Bethard
Steven Bethard added the comment: I have no objections on adding a howto, and something like the attached patch would be fine with me (though I don't have time to review it in full and trust you to). You might want to coordinate with Issue 13850 a bit - they want a quick reference

[issue14075] argparse: unused method?

2012-02-21 Thread Steven Bethard
Steven Bethard added the comment: Yeah, the intention was that you could just override _get_args in a subclass to get a better __repr__. I think these days all the argparse classes only have keyword arguments, so _get_args probably isn't necessary an

[issue14034] Add argparse howto

2012-02-22 Thread Steven Bethard
Steven Bethard added the comment: Oh ok. Sounds good then! -- ___ Python tracker <http://bugs.python.org/issue14034> ___ ___ Python-bugs-list mailing list Unsub

[issue14102] argparse: add ability to create a man page

2012-02-24 Thread Steven Bethard
Steven Bethard added the comment: I think adding a new formatter for man pages would be generally useful. Assuming someone provides a patch. ;-) -- ___ Python tracker <http://bugs.python.org/issue14

[issue14103] argparse: add ability to create a bash_completion script

2012-02-24 Thread Steven Bethard
Steven Bethard added the comment: Yeah, the same issues have been discussed in Issue 4256. My feeling so far is that if there isn't "one true format" that argparse can produce and be useful to a wide variety of shells, then it's probably not functionality that belongs

[issue4256] argparse: provide a simple way to get a programmatically useful list of options

2012-02-24 Thread Steven Bethard
Steven Bethard added the comment: So it seems like what bash needs and what zsh needs are pretty different. My feeling so far is that if there isn't "one true format" that argparse can produce and be useful to a wide variety of shells, then it's probably not functiona

[issue14046] argparse: assertion failure if optional argument has square/round brackets in metavar

2012-02-25 Thread Steven Bethard
Steven Bethard added the comment: Yes, this is a known bug (Issue 11874). Patches welcome. -- resolution: -> duplicate superseder: -> argparse assertion failure with brackets in metavars ___ Python tracker <http://bugs.python.org/i

[issue14074] argparse allows nargs>1 for positional arguments but doesn't allow metavar to be a tuple

2012-02-25 Thread Steven Bethard
Steven Bethard added the comment: Looks like the problem is that "_format_action_invocation" is not being as careful with the different possibilities for metavar as "_format_args" is. Patches welcome! -- ___ P

[issue14075] argparse: unused method?

2012-02-25 Thread Steven Bethard
Steven Bethard added the comment: It's undocumented, and it begins with an underscore, but it would certainly be safer to deprecate it first. -- ___ Python tracker <http://bugs.python.org/is

[issue14149] argparse usage model requires argument names to be python identifiers

2012-02-29 Thread Steven Bethard
Steven Bethard added the comment: For optional flags like --foo-bar, argparse does munge the "dest" to "foo_bar", following optparse. For positional arguments, arpgarse doesn't munge things this way, but if you want the argument named "foo-bar" in help messa

[issue14149] argparse: Document how to use argument names that are not Python identifiers

2012-02-29 Thread Steven Bethard
Steven Bethard added the comment: > making Namespace subscriptable This has been discussed before - see issue 11076. I prefer to keep Namespace as simple as possible. For subscripting, just use the standard Python idiom of vars as suggested in the docs: http://docs.python.org/libr

[issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb'

2012-02-29 Thread Steven Bethard
Steven Bethard added the comment: Yes, the problem is in FileType.__call__ - the handling of '-' is pretty simplistic. Patches welcome. -- ___ Python tracker <http://bugs.python.o

[issue14191] argparse: nargs='*' doesn't get out-of-order positional parameters

2012-03-06 Thread Steven Bethard
Steven Bethard added the comment: This behavior is intentional - positional arguments must be sequential, not broken up with optional (flag) arguments between. So this is a documentation bug. Allowing positional arguments to be broken up with optional (flag) arguments between them would be

[issue14191] argparse: nargs='*' doesn't get out-of-order positional parameters

2012-03-07 Thread Steven Bethard
Steven Bethard added the comment: > optparse, which argparse attempts to replace, permitted positional > arguments to be intermixed with optional arguments Sure, but optparse didn't actually parse positional arguments - it just threw them into a bag, and then you had to gro

[issue14191] argparse: nargs='*' doesn't get out-of-order positional parameters

2012-03-08 Thread Steven Bethard
Steven Bethard added the comment: > Hence, I conclude that, unless this was spelled out in the PEP and I > missed it, that having such boundaries is a bug Practically speaking, we just can't change this because it will break existing argparse scripts. Argparse has had this beh

[issue14191] argparse: nargs='*' doesn't get out-of-order positional parameters

2012-03-08 Thread Steven Bethard
Steven Bethard added the comment: Thinking about it a bit more, it strikes me that maybe you could get the behavior you want by declaring two parsers, one with just optionals, and one with just positionals. Then: optional_args, remaining_args = optionals.parse_known_args() args

[issue14191] argparse: nargs='*' doesn't get out-of-order positional parameters

2012-03-08 Thread Steven Bethard
Steven Bethard added the comment: Actually, that could be even simpler: args, remaining_args = optionals.parse_known_args() args = positionals.parse_args(remaining_args, args) -- ___ Python tracker <http://bugs.python.org/issue14

[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

[issue13922] argparse handling multiple "--" in args improperly

2012-03-18 Thread Steven Bethard
Steven Bethard added the comment: Ok, I agree - I'm fine with it as a bugfix. Depending on the removal of extra -- strings would be pretty crazy anyway. ;-) -- ___ Python tracker <http://bugs.python.org/is

[issue14364] Argparse incorrectly handles '--'

2012-03-18 Thread Steven Bethard
Steven Bethard added the comment: I just tried this with grep's "-e" and "--regexp": $ cat > temp.txt a--b cdef $ grep -e-- -v temp.txt cdef $ grep --regexp=-- -v temp.txt cdef $ grep -e -- -v temp.txt cdef $ grep --regexp -- -v temp.txt cdef And with diff's

[issue13922] argparse handling multiple "--" in args improperly

2012-03-18 Thread Steven Bethard
Steven Bethard added the comment: > It prevents implementing parsers that pass strings on to another > sub-parser or command. ... > wouldn't you use 'parse_known_args' instead of 'parse_args' > and pass the remaining arguments to the next script I'll

[issue14365] argparse: subparsers, argument abbreviations and ambiguous option

2012-03-18 Thread Steven Bethard
Steven Bethard added the comment: Yep. Closing as duplicate. -- resolution: -> duplicate status: open -> closed superseder: -> argparse: allow abbreviation of sub commands by users ___ Python tracker <http://bugs.python.or

[issue14365] argparse: subparsers, argument abbreviations and ambiguous option

2012-03-18 Thread Steven Bethard
Steven Bethard added the comment: My mistake. I see that the error you're getting is a bad interaction between the option in the main parser and an ambiguous option in the subparser. -- resolution: duplicate -> status: closed -> open superseder: argparse: allow abbrevia

[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 >

[issue14365] argparse: subparsers, argument abbreviations and ambiguous option

2012-03-18 Thread Steven Bethard
Steven Bethard added the comment: The problem is basically that _parse_known_args calls _parse_optional to determine whether something is an optional or a positional. But _parse_optional only checks "if arg_string in self._option_string_actions", that is, if the string can be fo

[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

<    4   5   6   7   8   9   10   11   12   13   >