[issue42776] The string find method shows the problem

2020-12-28 Thread Steven D'Aprano
Steven D'Aprano added the comment: # True data.find('a', 0) That will return 0, not True. # False data.find('a', start=0) And that will raise TypeError, not return False. What exactly are you reporting here? I have read your bug report, and looked at the screen

[issue42765] Introduce new data model method __iter_items__

2020-12-28 Thread Steven D'Aprano
Steven D'Aprano added the comment: Hi Richard, > Also, using _asdict() seems strange as an exposed API, since it's an > underscore method and users hence might not be inclined to use it. I don't consider this a strong argument. Named tuple in general has to use a

[issue42751] Imaplib

2020-12-26 Thread Steven D'Aprano
Steven D'Aprano added the comment: Are you the owner of imaplib2? If so, you need to ensure that there are no licencing or copyright issues preventing imaplib2 being transferred into the stdlib. That may (or may not) require you to get agreement from any contributors to the library.

[issue42733] io's r+ mode truncate(0)

2020-12-25 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Sat, Dec 26, 2020 at 02:19:55AM +, Terry J. Reedy wrote: > "Enhancements" (non-bugfix feature changes) can only be applied to > future versions. However, you are asking for the reversion of an > intentional feature change ma

[issue42733] [issue] io's r+ mode truncate(0)

2020-12-25 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Fri, Dec 25, 2020 at 01:31:51PM +, 施文峰 wrote: > first test have a problem,you didn’t use r+ mode I did, I copied your `test()` function exactly, however I did make a mistake. I tried again with this: >>> with open(FILE_PATH, 'r

[issue42733] [issue] io's r+ mode truncate(0)

2020-12-25 Thread Steven D'Aprano
Steven D'Aprano added the comment: You say: > after process python3 test_case.py > json file's content like this > > @@{"how_dare_you": "how_dare_you"} I cannot replicate that result. I created a "data.json" with the followi

[issue38308] Add optional weighting to statistics.harmonic_mean()

2020-12-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: Okay, I'm satisfied with that reasoning, thanks Raymond. Patch looks good to me. Go for it! Have a good Christmas and stay safe. -- ___ Python tracker <https://bugs.python.o

[issue38308] Add optional weighting to statistics.harmonic_mean()

2020-12-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: I like the addition but I'm not sure why you removed the price-earnings ratio example from the docs. I think that it's useful to have an example that shows that harmonic mean is not *just* for speed-related problems. I'm not going t

[issue42723] Unclear why dict unpacking cannot be used in dict comprehension

2020-12-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: They don't do the same thing. The dict comprehension requires a single key:value pair per loop. It accumulates values into a single dict. Try this: d = {} for key, value in items: print(id(d)) d[key] = value The ID does

[issue42699] Use `.join(k for k in g)` instead of `.join([k for k in g])`

2020-12-21 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Mon, Dec 21, 2020 at 09:11:48PM +, Samuel Marks wrote: > There were only 12k occurrences, I'm sure I could manually go through that > in an afternoon. Would you accept it then? Assuming "an afternoon" is half a work d

[issue42686] include built-in Math functions in SQLite to 3.35.0 of march 2021

2020-12-21 Thread Steven D'Aprano
Steven D'Aprano added the comment: It is probably harmless to enable the option, especially if it will be the SQLite default, but why would you do your maths computations in sql, using the limited set of functions available, when you could do them in Python, with a much larger s

[issue42699] Use `.join(k for k in g)` instead of `.join([k for k in g])`

2020-12-20 Thread Steven D'Aprano
Steven D'Aprano added the comment: By the way, it is almost always wrong to write "k for k in iterable" when you can just write "iterable" or "list(iterable)". Here are some micro-benchmarks: [steve ~]$ python3.9 -m timeit -s "from string im

[issue42686] include built-in Math functions in SQLite to 3.35.0 of march 2021

2020-12-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: As far as I can tell, every one of those are already available in Python. https://docs.python.org/3/library/math.html -- nosy: +steven.daprano ___ Python tracker <https://bugs.python.org/is

[issue23522] Misleading note in Statistics module documentation

2020-12-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: Sorry Raymond, I missed this before closing the task. > FWIW, Allen Downey also had concerns about this wording. I don't recognise the name, who is Allen Downey and what concerns does he have? -- _

[issue23522] Misleading note in Statistics module documentation

2020-12-18 Thread Steven D'Aprano
Change by Steven D'Aprano : -- resolution: -> rejected stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.pyth

[issue23522] Misleading note in Statistics module documentation

2020-12-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm willing to give Irit and Jake opportunity to make their case. Particularly if they can demonstrate that I got my facts wrong. I'm going to close the ticket, but if anyone feels strongly enough to respond with a good argument, or better

[issue42680] unicode identifiers not accessible or assignable through globals()

2020-12-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm pretty sure this is not a bug, but is working as designed. The interpreter normalises unicode identifiers, but key lookup in the dict does not. Sorry, I don't have time right now to give a more detailed answer, but there are two distinc

[issue23522] Misleading note in Statistics module documentation

2020-12-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: I strongly oppose this change, and I dispute the characterisation of this as a misleading note. It is not misleading, and I argue that every word of it is factually correct. Jake, if you disagree, then please provide some citations. Irit: it is ridic

[issue42641] Deprecate os.popen() function

2020-12-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: > There is also the os.system() function which exposes the libc system() > function. Should we deprecate this one as well? Please don't deprecate os.system. For quick and dirty scripts used in trusted environments with trusted data, it

[issue42654] Add folder for python customizations: __sitecustomize__

2020-12-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: > Additionally, it suffers from the same issue as > sitecustomize. It is a single file that won't be a real substitute for > code execution in pth files. I thought that the consensus in b.p.o. #33944 is that code execution in pth files

[issue42656] prime numbers loop issue

2020-12-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: Hello valeriymartsyshyn, This is for reporting bugs in the Python interpreter, it is not a help desk for learning how to program in Python. There are many places you can ask for help to debug your code, such as Reddit's r/learnpython, or Stackov

[issue42654] Add folder for python customizations: __sitecustomize__

2020-12-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: Shouldn't this be discussed on Python-Ideas? I'm pretty sure this is a big enough change that it will need a PEP. If you need code run on startup, can't you just put it in the PYTHONSTARTUP file? -- n

[issue42623] Syntax Error showing pointer in wrong location

2020-12-12 Thread Steven D'Aprano
Steven D'Aprano added the comment: > @ Steven, did you mean to un-nosy Pratik? No. I have tried to re-add him, but I think that because his user name is all digits, the bug tracker won't accept it. When I try, I get this error: Edit Error: user has no

[issue42623] Syntax Error showing pointer in wrong location

2020-12-11 Thread Steven D'Aprano
Steven D'Aprano added the comment: The position of the caret assumes that every character in the string takes up the same width, measured in pixels. That is only true for monospaced fonts like Courier. The only way to position the caret precisely with a proportional-width font i

[issue42614] Pathlib does not support a Cyrillic character 'й'

2020-12-10 Thread Steven D'Aprano
Steven D'Aprano added the comment: In addition, you are probably hitting normalization issues. There are two ways to get the Cyrillic character 'й' in your string, one of them is a single code point, the other is two code points: >>> a = 'й' >>>

[issue42614] Pathlib does not support a Cyrillic character 'й'

2020-12-10 Thread Steven D'Aprano
Steven D'Aprano added the comment: You are comparing the name with the file extension against the name without the file extension: >>> "Файл на български.ldr" == "Файл на български" False -- nosy: +steven.daprano

[issue42578] Add tip when encountering UnicodeDecode/EncodeError in open()

2020-12-05 Thread Steven D'Aprano
Steven D'Aprano added the comment: "Maybe a helpful tip can be added to the error message." What sort of helpful tip do you have in mind? Remember that the error doesn't occur when the file is opened, but some time later. -- n

[issue42575] Suggest to add an LinkedList data structure to python

2020-12-05 Thread Steven D'Aprano
Steven D'Aprano added the comment: The class you have provided is awkward to use, random access is inefficient, it is not compatible with lists or offer a sequence API, it's not subscriptable or iterable, the API exposes an unnecessary "Proxy" class, and the API is mor

[issue42570] Try and Except doesn't work properly

2020-12-04 Thread Steven D'Aprano
Steven D'Aprano added the comment: Code is working correctly, not a bug. Perhaps you are mistaking `continue` for `break`. Kshitish, we keep telling you not to use the bug tracker as a help desk. This is now your eighth "bug report" that was 100% your misunderstanding. There

[issue42546] copy - Allow .copy(deep=True) alongside .deepcopy() for easier usage and zen

2020-12-02 Thread Steven D'Aprano
Steven D'Aprano added the comment: This would be a classic example of the "Flag argument" anti-pattern: https://www.martinfowler.com/bliki/FlagArgument.html -- nosy: +steven.daprano ___ Python tracker <https://bugs.pyt

[issue42497] New pathlib.Path attribute

2020-11-29 Thread Steven D'Aprano
Steven D'Aprano added the comment: As a new feature, this could only go into 3.10, 3.9 is in feature freeze. The requirements are unclear, it could mean any of: - the file's *owner* has the execute bit set; - the file's mode has any execute bit set; - the *current us

[issue42494] struct.unpack_from return 2 values instead of one

2020-11-28 Thread Steven D'Aprano
Steven D'Aprano added the comment: Hi Sébastien, This is a bug tracker for reporting bugs, not a help desk to help with your code. There are many community resources to help you debug your code, but this is not one of them. You can try: * Reddit's /r/learnpython * the Python-li

[issue42490] Business Logical Error

2020-11-28 Thread Steven D'Aprano
Steven D'Aprano added the comment: Nishant Gautam does not understand not condition. This is your sixth incorrect bug report in a row. Please stop. This is not a help desk to correct your mistakes. a == 10 and (b != (not(11))) and b == a --> True and (b != False) and True --> Tr

[issue42488] Mathematical error

2020-11-28 Thread Steven D'Aprano
Steven D'Aprano added the comment: The ^ operator is bitwise-xor (exclusive-or), not exponentiation. Stop wasting our time by posting false bug reports. This is now your fifth incorrect bug report in a row. Once or twice can be forgiven that you didn't know better. Please stop

[issue42482] TracebackException should not hold reference to the exception traceback

2020-11-27 Thread Steven D'Aprano
Steven D'Aprano added the comment: Re-adding older versions. -- versions: +Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/is

[issue42482] TracebackException should not hold reference to the exception traceback

2020-11-27 Thread Steven D'Aprano
Steven D'Aprano added the comment: This would be a change of behaviour, and 3.8 and 3.9 are in feature freeze, so we could only add it in 3.10. You say: "it's supposed to capture the output without holding references to real things" Is this requirement documented some

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

[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

[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

[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

[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

[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

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

[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

[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

[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

[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

[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

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

[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

[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

[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

[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

[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

[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

[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

[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

[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
Change by Steven D'Aprano : -- title: f***ing setup failed is driving me insane -> setup error on windows ___ Python tracker <https://bugs.python.org

[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

[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

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

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

[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

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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

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

[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

[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

[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

[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', &

[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

[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

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

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

2020-08-21 Thread Steven D'Aprano
Steven D'Aprano added the comment: Vedran: you are quoting von Neumann out of context, he was talking about generating random numbers, not rounding, and in the seven decades since he made his famous witticism, we of course know that there is absolutely nothing wrong with generating r

[issue41590] "zip()" very slowly for this

2020-08-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: If you know about timeit, why aren't you using it? In any case, I have just ran your nested_lists.py file, and on my computer, the last version with zip is the fastest version: 0 transpose1_0(lT) Time = 1.0627508163452149e-05 7 zip

[issue41590] "zip()" very slowly for this

2020-08-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: What are you actually reporting? What part of the documentation do you think should be changed, why should it be changed, and what should it be changed to? It is normal for different algorithms to perform with different speed. I'm not sure what t

[issue41563] .python_history file causes considerable slowdown

2020-08-17 Thread Steven D'Aprano
Steven D'Aprano added the comment: > My history file is only 500 lines. *slaps forehead* Of course it is, I'm running a customer history hook that has a limit of 500 lines in the history file. It looks to me that by default the history feature is set to unlimited lines, so

[issue41563] .python_history file causes considerable slowdown

2020-08-17 Thread Steven D'Aprano
Steven D'Aprano added the comment: How very odd. I use the Python interactive interpreter extensively, and have done so for years. My history file is only 500 lines. Did you happen to inspect the file before deleting it to see if it contained something odd? What does this print fo

[issue41558] Backspace not clearing the text

2020-08-15 Thread Steven D'Aprano
Steven D'Aprano added the comment: Works correctly for me in the Python interpreter. Please check if it works for you in the Python interpreter, if it does, then it is a bug in Jupyter and should be reported to them, we cannot do anything to fix it. -- nosy: +steven.da

[issue41542] module `__all__` cannot detect function name with `φ`

2020-08-14 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Fri, Aug 14, 2020 at 02:03:37PM +, Seth Woodworth wrote: > I'm exploring what unicode code points can be used as valid starting > characters for identifiers. I presume you have seen the documention here: https://docs.python

[issue41545] gc API requiring matching number of gc.disable - gc.enable calls

2020-08-13 Thread Steven D'Aprano
Steven D'Aprano added the comment: > I wrap a function's logic with `gc.disable()` to prevent GC from triggering > some race condition. If this race condition is a bug in gc, then we should fix that. If it is a bug in your code, surely you should fix that rather than disable

[issue41542] module `__all__` cannot detect function name with `φ`

2020-08-13 Thread Steven D'Aprano
Steven D'Aprano added the comment: Hi Seth, Surely you aren't relying on the behaviour that names in `__all__` *aren't* normalised but others are? Rather than a warning, I think the right solution here is to normalise the names in `__all__`. -- nosy:

[issue41518] incorrect printing behavior with parenthesis symbols

2020-08-11 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Tue, Aug 11, 2020 at 07:16:20AM +, Ramesh Sahoo wrote: > for i in stack: > print("inside if Popped =",stack.pop(stack.index(i))) You are mutating the list while you iterate over it. This is prone to cause trouble. Her

[issue41517] Able to subclass enum with members by using multiple inheritance

2020-08-10 Thread Steven D'Aprano
Steven D'Aprano added the comment: The documentation says: "Allowing subclassing of enums that define members would lead to a violation of some important invariants of types and instances." but it isn't clear what those invariants are, or why it is more of a problem

[issue41518] incorrect printing behavior with parenthesis symbols

2020-08-10 Thread Steven D'Aprano
Steven D'Aprano added the comment: Python 3.6 has reached security-fix only stage: https://www.python.org/dev/peps/pep-0494/#schedule-last-bugfix-release so even if this is a bug, it won't be fixed in 3.6. I cannot reproduce this in 3.7, and Eric cannot reproduce in 3.6.9, so I&

[issue41495] SPAM

2020-08-06 Thread Steven D'Aprano
Change by Steven D'Aprano : -- resolution: -> not a bug stage: -> resolved status: open -> closed title: Technical advise -> SPAM ___ Python tracker <https://bugs.p

[issue41495] Technical advise

2020-08-06 Thread Steven D'Aprano
Change by Steven D'Aprano : -- Removed message: https://bugs.python.org/msg374932 ___ Python tracker <https://bugs.python.org/issue41495> ___ ___ Pytho

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