[issue30608] argparse calculates string widths incorrectly

2017-06-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: By the way, perhaps a simpler demonstration which is more likely to render correctly on most people's systems would be to use Latin-1 combining characters: py> s1 = 'àéîõü' py> s2 = unicodedata.normalize('NFD', s1) # decom

[issue36018] Add a Normal Distribution class to the statistics module

2019-02-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: Karthikeyan: thanks for the hint about Github. Raymond: thanks for the diff. Some comments: Why use object.__setattr__(self, 'mu', mu) instead of self.mu = mu in the __init__ method? Should __pos__ return a copy rather than the instance it

[issue36099] Clarify the difference between mu and xbar in the statistics documentation

2019-02-23 Thread Steven D'Aprano
New submission from Steven D'Aprano : The documentation isn't clear as to the difference between mu and xbar, and why one is used in variance and the other in pvariance. See #36018 for discussion. For the record: mu or μ is the population parameter, i.e. the mean of the entire popu

[issue36018] Add a Normal Distribution class to the statistics module

2019-02-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: Davin: the chice of using mu versus xbar was deliberate, as they represent different quantities: the population mean versus a sample mean. But reading over the docs with fresh eyes, I can now see that the distinction is not as clear as I intended. I

[issue36099] Clarify the difference between mu and xbar in the statistics documentation

2019-02-24 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm happy with that doc change. If nobody objects, this might make an easy "Good first issue" for the upcoming sprint. Assigning to Cheryl to stop anyone else grabbing it. -- assignee: docs@python -> cheryl.sabell

[issue36100] int() and float() should accept any isnumeric() digit

2019-02-24 Thread Steven D'Aprano
Steven D'Aprano added the comment: I think that analysis is wrong. The Wikipedia page describes the meaning of the Unicode Decimal/Digit/Numeric properties: https://en.wikipedia.org/wiki/Unicode_character_property#Numeric_values_and_types and the characters you show aren't appro

[issue36100] int() and float() should accept any isnumeric() digit

2019-02-24 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Sun, Feb 24, 2019 at 11:07:41AM +, Karthikeyan Singaravelan wrote: > Is this worth an FAQ or an addition to the existing note on int that > specifies characters should belong to 'Nd' category to add a note that > str.isde

[issue36100] Document the differences between str.isdigit, isdecimal and isnumeric

2019-02-24 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm re-opening the ticket with a change of subject, because I think this should be treated as a documentation enhancement: - improve the docstrings for str.isdigit, isnumeric and isdecimal to make it clear what each does (e.g. what counts

[issue36111] Negative `offset` values are no longer acceptable with implementation of `seek` with python3; should be per POSIX

2019-02-25 Thread Steven D'Aprano
Steven D'Aprano added the comment: I believe you will find that this is because you opened the file in text mode, which means Unicode, not bytes. If you open it in binary mode, the POSIX spec applies: py> fp = open("sample", "rb"); fp.seek(-100, os.SEEK_EN

[issue35892] Fix awkwardness of statistics.mode() for multimodal datasets

2019-02-25 Thread Steven D'Aprano
Steven D'Aprano added the comment: Executive summary: - let's change the behaviour of mode to return a single mode rather than raise an exception if there are multimodes; - and let's do it without a depreciation period. Further comments in no particular order: I agree that

[issue35892] Fix awkwardness of statistics.mode() for multimodal datasets

2019-02-25 Thread Steven D'Aprano
Steven D'Aprano added the comment: What do people think about leaving this as an "Easy First Issue" for the sprint? If others agree that it is sufficiently easy, we can assign the task to Cheryl. It should be fairly easy: mode calls an internal function _counts which is not

[issue36118] Cannot correctly concatenate nested list that contains more than ~45 entries with other nested lists.

2019-02-26 Thread Steven D'Aprano
Steven D'Aprano added the comment: I cannot reproduce the behaviour you show. First problem: ``...`` is a legal Python object, Ellipsis, so your example code literally means: # x = [["a", "b", ... , "BZ"]] x is a list containing one sublist, which contai

[issue35892] Fix awkwardness of statistics.mode() for multimodal datasets

2019-02-26 Thread Steven D'Aprano
Steven D'Aprano added the comment: > Proposed spec: > ''' > Modify the API statistics.mode to handle multimodal cases so that the > first mode encountered is the one returned. If the input is empty, > raise a StatisticsError. Are you happy guaranteeing th

[issue36151] Incorrect answer when calculating 11/3

2019-02-28 Thread Steven D'Aprano
Steven D'Aprano added the comment: Aiden: in the future, please do not post unnecessary screenshots of text. They are hostile to the blind and slight-impaired, they make it impossible to copy your code and run it ourselves, and they cannot be searched for. Instead, copy and paste the

[issue36156] different method, but id function return same value.

2019-03-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: bugs.python.org seems to be down at the moment, so please forgive me if this ticket has already been closed and I'm repeating what has already been said. > This is guaranteed to be unique among simultaneously existing objects. Note the *s

[issue36163] same object, same method, but the is keyword return false.

2019-03-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: The ``is`` operator returns False because the two objects are different objects. Methods are descriptors, and whenever you access an instance method, you get a brand-new method object. This is described in the documentation for descriptors:

[issue36158] Regex search behaves differently in list comprehension

2019-03-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: > i want to apply a regex on a list of strings. The example you give doesn't include a list of strings, it has some unknown "entity" object with an unknown "trigger" attribute. Please refactor the code to remove the use o

[issue36173] BROTHER PRINTER CENTER

2019-03-03 Thread Steven D'Aprano
New submission from Steven D'Aprano : No details given and a spammy, irrelevant title. Closing. Dianmatang, if you are an actual person and not a spam bot, please try adding details of the bug, and using a more informative title. -- nosy: +steven.daprano resolution: -> n

[issue36178] type.__init__ called instead of cls.__init__ when inheriting from type.

2019-03-04 Thread Steven D'Aprano
Steven D'Aprano added the comment: Your metaclass.__new__ method returns None instead of the new class. The rule for calling __init__ is: - if the constructor __new__ returns an instance of the type, then call the initializer __init__ - otherwise, don't call __init__ at a

[issue36206] re.match() not matching escaped hyphens

2019-03-05 Thread Steven D'Aprano
Steven D'Aprano added the comment: You don't escape the text you are searching. Try this: py> re.match(re.escape('-'), "-") <_sre.SRE_Match object; span=(0, 1), match='-'> py> re.match(re.escape('a-c'), "a-c&q

[issue36243] Python os.listdir fails with FileNotFoundError when directory exists

2019-03-08 Thread Steven D'Aprano
Steven D'Aprano added the comment: > How can this happen? Easily -- this looks like a "Time Of Check To Time Of Use" bug. You check for the existence of a directory, and then a fraction of a second later you attempt to use that directory. But on a multi-processing ope

[issue36248] document about `or`, `and` operator.

2019-03-08 Thread Steven D'Aprano
Steven D'Aprano added the comment: Document *what* about the behaviour shown? I'm sure you don't mean to say that we should document the fact the *literally* `1 or 0 and 3` returns 1, but I don't know what you think we should document beyond what is already stated in th

[issue36255] Provide a simple way to delete and edit python's welcome message

2019-03-10 Thread Steven D'Aprano
Steven D'Aprano added the comment: Why do you want to disable the welcome message? > I just want to add a line after the first one to give system information. Sounds like you just want to print something extra, after the welcome message has been printed. -- nosy: +steven

[issue36259] exception text is being sourced from the wrong file

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

[issue28956] return list of modes for a multimodal distribution instead of raising a StatisticsError

2019-03-11 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm closing this issue in favour of Raymond's #35892, thank you to everyone even if your PRs didn't get used, I appreciate your efforts. -- resolution: -> rejected stage: patch review -> resol

[issue36018] Add a Normal Distribution class to the statistics module

2019-03-11 Thread Steven D'Aprano
Steven D'Aprano added the comment: I've done some spot checks of NormDist.pdf and .cdf and compared the results to those returned by my TI Nspire calculator. So far, the PDF has matched that of the Nspire to 12 decimal places (the limit the calculator will show), but the CDF dif

[issue35892] Fix awkwardness of statistics.mode() for multimodal datasets

2019-03-11 Thread Steven D'Aprano
Steven D'Aprano added the comment: Looks good to me, I'm happy to accept it. Thank you for your efforts Raymond, can I trouble you to do the merge yourself please, I'm still having issues using the Github website. -- ___ Python

[issue36018] Add a Normal Distribution class to the statistics module

2019-03-11 Thread Steven D'Aprano
Steven D'Aprano added the comment: > I'm assuming you meant 5.374 rather than 5.372 in the first Nspire result. Yes, that was a typo, sorry. Thanks for checking into the results. -- ___ Python tracker <https://bugs.pytho

[issue36283] eval is needlessly limited

2019-03-13 Thread Steven D'Aprano
Steven D'Aprano added the comment: > The footnote about why eval/exec cannot be used for arbitrary code Which footnote? I see nothing here: https://docs.python.org/3/library/functions.html#eval > On that point, I still don't understand why PyObject_GetIte

[issue36314] Pivot_Table Docstring Error

2019-03-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: Prakhar, for future reference, please don't submit unnecessary screenshots to report bugs. Screen shots are hostile to the blind or visually impaired, who may be reading this with a screen-reader, and they make it impossible for us to copy your c

[issue36324] Inverse cumulative normal distribution function

2019-03-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: Looks good to me. Later I will do some spot checks against the results returned by the Nspire calculator, but in the meantime I think this can go in. Thanks for your efforts Raymond, I think this NormalDist is shaping up to be a great add

[issue36324] Inverse cumulative normal distribution function

2019-03-20 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Tue, Mar 19, 2019 at 01:06:45AM +0000, Steven D'Aprano wrote: > Later I will do some spot checks against the results returned by the Nspire > calculator Looks good to me, they agree to 6 decimal places in my tests. Following Mark's

[issue6422] timeit called from within Python should allow autoranging

2019-03-27 Thread Steven D'Aprano
Steven D'Aprano added the comment: > Were you working on the additional functionality that you mentioned in > msg272704 or would that be open for someone else to do? Thanks! Please consider it open. I don't expect it to be difficult, it's just finding the Round Tuits.

[issue27181] Add geometric mean to `statistics` module

2019-03-28 Thread Steven D'Aprano
Steven D'Aprano added the comment: > In the spirit of "perfect is the enemy of good", would it be > reasonable to start with a simple, fast implementation using > exp-mean-log? Then if someone wants to make it more accurate later, > they can do so. I think th

[issue35224] PEP 572: Assignment Expressions

2019-03-29 Thread Steven D'Aprano
Steven D'Aprano added the comment: You are one person, who has used this feature for what, a month elapsed time? 300 person-hours actual experience with it? Allowing top-level unparenthisized walrus expressions will affect hundreds of thousands of people, for collectively millions of

[issue36507] frozenset type breaks ZFC

2019-04-02 Thread Steven D'Aprano
Steven D'Aprano added the comment: Python is a programming language, and we're probably not going to care too much about compliance with ZFC set theory unless there is good *practical* and not theoretical reason to care. That's not to say that we want to break ZFC, only that

[issue36507] frozenset type breaks ZFC

2019-04-02 Thread Steven D'Aprano
Steven D'Aprano added the comment: (Aside: that's interesting, normally if I try to post a comment to an issue, and somebody else edits it in the meantime, the message doesn't get posted and I get a error message saying that the page has been edited. This

[issue36493] Add math.midpoint(a,b) function

2019-04-02 Thread Steven D'Aprano
Steven D'Aprano added the comment: I see this has been rejected for the math module, but I wonder whether it should be considered for Decimal? I recall Mark Dickinson demonstrating this lovely little bit of behaviour: py> from decimal import getcontext, Decimal py> getcontext().

[issue36549] str.capitalize should titlecase the first character not uppercase

2019-04-07 Thread Steven D'Aprano
New submission from Steven D'Aprano : str.capitalize appears to uppercase the first character of the string, which is okay for ASCII but not for non-English letters. For example, the letter NJ in Croatian appears as Nj at the start of words when the first character is capitalized: Nje

[issue36546] Add quantiles() to the statistics module

2019-04-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: I think adding quantiles (sometimes called fractiles) is a good feature to add. I especially have some use-cases for quartiles. I especially like that it delegates to the inv_cdf() method when available, and I'm happy with the API you suggested

[issue36566] Support password masking in getpass.getpass()

2019-04-08 Thread Steven Vascellaro
New submission from Steven Vascellaro : Support password masking in getpass.getpass() Currently, getpass.getpass() hides all user input when entering a password. This can throw off non-Unix users who are used to passwords being masked with asterisks *. This has led some users to write their

[issue36574] Error with self in python

2019-04-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: The file you have attached doesn't seem to be a Python script, it seems to be some sort of Windows batch file or similar. Please supply an actual Python file. (Hint: remove the "del code.py" line from your batch file.) Also, copy and

[issue36574] Error with self in python

2019-04-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: The error message is correct. The bug is in your code. Also, the code you tell us that you are running is not the same as the code you are actually running. You should not call __init__ directly as you do: # this is wrong Person.__init__(

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

2019-04-09 Thread Steven Vascellaro
Steven Vascellaro added the comment: @matanya.stroh: Don't forget to erase the asterisks if the user hits backspace. ``` def win_getpass(prompt='Password: ', stream=None, show_asterisks=False): """Prompt for password with echo off, using Windows getch().&

[issue36617] The rich comparison operators are second class citizens

2019-04-12 Thread Steven D'Aprano
Steven D'Aprano added the comment: Sorry, I don't understand your demonstration. What's the mystery ``parser`` object with an ``expr`` method? What is it doing? Your comment says "all binary/unary number ops work" but I don't know what you mean by "work&q

[issue36646] os.listdir() got permission error in Python3.6 but it's fine in Python2.7

2019-04-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: Please don't post screen shots of text, copy and paste the text as text. Screen shots are hostile to the blind and visually impaired as screen-readers don't work with them. They make it impossible for us to copy your code to run it ourselv

[issue36646] os.listdir() got permission error in Python3.6 but it's fine in Python2.7

2019-04-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: Thanks Ryan. > PermissionError: [WinError 5] 拒绝访问。: 'L:\\Temp' Can you translate the error message into English for us please? -- ___ Python tracker <https://bugs.

[issue36653] Dictionary Key is without ' ' quotes

2019-04-17 Thread Steven D'Aprano
Steven D'Aprano added the comment: Hi PushkarVaity, and welcome! I hope that Matthew's suggestion fixes your code for you, but please remember that this is a bug tracker for bugs in the Python language and standard library, not a help desk. As a beginner, 99.9% of the times you

[issue36657] AttributeError

2019-04-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: Hi Maakvol, Please remember that this is a bug tracker for bugs in the Python language and standard library, not a help desk. As a beginner, 99.9% of the times you think that you have found a bug in Python, you haven't, it will be a bug in you

[issue36675] Doctest directives and comments not visible or missing from code samples

2019-04-20 Thread Steven D'Aprano
New submission from Steven D'Aprano : (Apologies if this is the wrong place for reporting website bugs.) The website is not rendering doctest directives or comments, either that or the comments have been stripped from the examples. On the doctest page itself, all the comments are mi

[issue36546] Add quantiles() to the statistics module

2019-04-26 Thread Steven D'Aprano
Steven D'Aprano added the comment: Hi Raymond, Thanks for working on this, I'm really keen to see this happen and I appreciate your efforts so far. Your arguments have also convinced me that the default calculation type you chose (PERCENTILE.EXC or R type=6) is suitable. Bu

[issue36754] Remove smart quotes in pydoc text

2019-04-29 Thread Steven D'Aprano
Steven D'Aprano added the comment: > Not all console configurations can correctly render smart quotes in > help() text. See the "Æ" in "superclass's" below. That suggests to me a mismatch in encodings, rather than inability to render curly quotes at all. I

[issue36774] f-strings: Add a !d conversion for ease of debugging

2019-05-02 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Thu, May 02, 2019 at 11:40:45AM +, Eric V. Smith wrote: > > New submission from Eric V. Smith : > > I originally propsed this here: > https://mail.python.org/pipermail/python-ideas/2018-October/053956.html, and > there has al

[issue36788] Add clamp() function to builtins

2019-05-03 Thread Steven D'Aprano
Steven D'Aprano added the comment: I doubt this is important enough to go into builtins, the only practical use-case I know of for this function is with numbers, so this could go in the math module. But putting that aside, there are some other problems: - it isn't clear that

[issue36774] f-strings: Add a !d conversion for ease of debugging

2019-05-03 Thread Steven D'Aprano
Steven D'Aprano added the comment: > Steven: We shouldn't block this immediately useful feature from going > in for f-strings on waiting for some much broader first class access > to expressions feature. !d would be practical today. I hear you, and after giving it much m

[issue36872] passing negative values through modules

2019-05-10 Thread Steven D'Aprano
Steven D'Aprano added the comment: David, I'm pretty sure that SilentGhost is correct. You are misreading the error message: it has nothing to do with the negative index. The problem is that your `insert_value` function returns None, not the list. I believe that what you have done

[issue36892] "Modules" section in Tutorial contains incorrect description about __init__.py

2019-05-11 Thread Steven D'Aprano
Steven D'Aprano added the comment: In my experience, beginners have enough trouble getting packages right without complicating the tutorial with a rarely-used advanced feature like namespace packages. I don't think this needs more than perhaps a footnote, if that. -

[issue36887] Add integer square root, math.isqrt

2019-05-11 Thread Steven D'Aprano
Steven D'Aprano added the comment: Yes please for this! The two usual versions are isqrt and nsqrt: isqrt(n) = largest integer ≤ √n nsqrt(n) = closest integer to √n although to be honest I'm not sure what use cases there are for nsqrt. -- nosy: +stev

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

2019-05-13 Thread Steven D'Aprano
Steven D'Aprano added the comment: +1 There's a long thread on something similar here: https://mail.python.org/pipermail/python-ideas/2018-March/049564.html Carrying over into the following month: https://mail.python.org/pipermail/python-ideas/2018-April/049582.html Here'

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

2019-05-15 Thread Steven D'Aprano
Steven D'Aprano added the comment: For the record, I just came across this proposed feature for Java: https://openjdk.java.net/jeps/8222530 Add text blocks to the Java language. A text block is a multi-line string literal that avoids the need for most escape sequ

[issue36675] Doctest directives and comments missing from code samples

2019-05-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: > Doctest directives in code examples should be suppressed everywhere > *except* in the doctest.html examples showing how to use directives. > The patch only exposes them for doctest.html and not for ctypes or > anywhere else. Thanks f

[issue32543] odd floor division behavior

2018-01-12 Thread Steven D'Aprano
Steven D'Aprano added the comment: That does look at first glance like a bug in // to me. 0.9/0.1 is correctly rounded to 9.0 exactly, so flooring it should return 9 (as it does): # Python 3.5 on Linux py> 0.9/0.1 == 9 True py> math.floor(0.9/0.1) 9 So I too would expect that 0.9/

[issue32589] Statistics as a result from timeit

2018-01-17 Thread Steven D'Aprano
Steven D'Aprano added the comment: What sort of statistics, and why do you think they are going to be meaningful? Measurement errors in the timings aren't two-sided, they are only one-sided, which means calculating the mean and standard deviation isn't appropriate. This is do

[issue32589] Statistics as a result from timeit

2018-01-17 Thread Steven D'Aprano
Steven D'Aprano added the comment: > What sort of statistics...? I answered my own question... I see that in your PR, you return a dict with the mean, median, *population* variance and standard deviation, and total. Why the population variance/stdev rather than the sample? Th

[issue32590] Proposal: add an "ensure(arg)" builtin for parameter validation

2018-01-17 Thread Steven D'Aprano
Steven D'Aprano added the comment: Oh I can just imagine the bike-shedding on this one :-) I'm not really convinced this is needed, but for what it's worth I think that given the intended use-case (checking function parameters) ValueError would be a more appropriate default

[issue32590] Proposal: add an "ensure(arg)" builtin for parameter validation

2018-01-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: Since this is intended for argument checking, i.e. testing preconditions, the Eiffel term "require" seems more appropriate. https://www.eiffel.org/doc/eiffel/ET:%20Design%20by%20Contract%20(tm),%20Assertions%20and%20Exception

[issue32603] Deprecation warning on strings used in re module

2018-01-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: I agree with Cheryl that it would be a good idea to mention this change in the re docs, since regexes are especially likely to run into this issue. -- nosy: +steven.daprano ___ Python tracker &

[issue32589] Statistics as a result from timeit

2018-01-20 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Fri, Jan 19, 2018 at 11:48:46PM +, STINNER Victor wrote: > The timeit module of the stdlib computes 5 values by default... I'm > not sure that it's revelant to compute the standard deviation only on > 5 values. I made the sam

[issue32607] After Python Installation Error

2018-01-21 Thread Steven D'Aprano
Steven D'Aprano added the comment: This looks like a broken or incorrectly configured Django installation. What happens when you run this from your operating system shell? python3.6 -E -S If you are on Windows, you might need to use this instead: py -E -S -- nosy: +steven.da

[issue32619] multiplication error

2018-01-22 Thread Steven D'Aprano
Steven D'Aprano added the comment: This is not a bug, it is a FAQ to do with the properties of binary floating point numbers. https://docs.python.org/3/faq/design.html#why-are-floating-point-calculations-so-inaccurate -- nosy: +steven.daprano resolution: -> not a b

[issue32657] Mutable Objects in SMTP send_message Signature

2018-01-24 Thread Steven D'Aprano
Steven D'Aprano added the comment: Hi Kenny, and thanks, but I'm not sure what your point is. Are you claiming this is a bug in the code or the documentation? For what it is worth... mutable defaults *are* a "gotcha", so the documentation isn't wrong. And mutable d

[issue32657] Mutable Objects in SMTP send_message Signature

2018-01-25 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Thu, Jan 25, 2018 at 02:28:17PM +, R. David Murray wrote: > obviously I missed that mutation of the value > in the code review of the patch that added those lines :( The docstring for send_message does say If the sender or any of th

[issue32669] cgitb file to print OSError exceptions

2018-01-25 Thread steven Michalske
New submission from steven Michalske : With the source ``` import cgitb import sys try: f = open('non_exitant_file_path.foo') except Exception as e: cgitb.text(sys.exc_info()) ``` we get the output ``` Traceback (most recent call last): File "foo.py", line

[issue32683] isinstance is calling ob.__getattribute__ as a fallback instead of object.__class__.__get__

2018-01-26 Thread Steven D'Aprano
Steven D'Aprano added the comment: Dan, I don't understand what you think the code snippet shows: you're calling isclass on an object which *actually is a class* and show that it returns True. What did you expect it to return? How does the code snippet you give demonstrate

[issue32778] Hi

2018-02-05 Thread Steven D'Aprano
Change by Steven D'Aprano : -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue32778> ___ ___ Python-bugs-

[issue32783] ln(2) isn't accurate in _math.c in cpython

2018-02-06 Thread Steven D'Aprano
Steven D'Aprano added the comment: Thanks for the link to the Stackoverflow discussion. Currently there are three answers: two (correctly) answer that the constant as given is the most accurate value for IEEE-754 floats. Tim Peters has answered that: https://stackoverflow.com/a/486

[issue32856] Optimize the `for y in [x]` idiom in comprehensions

2018-02-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: +1 Please also support using a one-element tuple: `for y in (f(x),)` -- nosy: +steven.daprano ___ Python tracker <https://bugs.python.org/is

[issue28956] return minimum of modes for a multimodal distribution instead of raising a StatisticsError

2018-02-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: What makes the minimum mode better than the maximum? -- ___ Python tracker <https://bugs.python.org/issue28956> ___ ___

[issue32876] HTMLParser raises exception on some inputs

2018-02-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: The stdlib HTML parser requires correct HTML. To parse broken HTML, as you find in the real world, you need a third-party library like BeautifulSoup. BeautifulSoup is much more complex (about 7-8 times as many LOC) but can handle nearly anything a br

[issue32906] AttributeError: 'NoneType' object has no attribute 'sendall'

2018-02-21 Thread Steven D'Aprano
Steven D'Aprano added the comment: Hi, this is for tracking bugs in the Python interpreter and standard library, not asking for help debugging your own code. There's no reason (yet) to believe this error is a bug in Python, you need to debug it first to ensure it is not a bug i

[issue32917] ConfigParser writes a superfluous final blank line

2018-02-22 Thread Steven D'Aprano
Steven D'Aprano added the comment: Its not a superfluous blank line. It is standard convention for Unix tools to end text files (of which ini files are a kind of text file) with a final newline \n. There are various reasons for this, but it doesn't matter what those reason

[issue32917] ConfigParser writes a superfluous final blank line

2018-02-22 Thread Steven D'Aprano
Steven D'Aprano added the comment: Oh, I forgot... even if it is decided that this trim_final_blankline parameter was desirable, the patch isn't sufficient to be accepted. You would need to also supply documentation and tests. --

[issue32929] Change dataclasses hashing to use unsafe_hash boolean (default to False)

2018-02-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: This is a truly awful name, there's nothing unsafe about the hash parameter. We rightly hesitate to label *actual* unsafe functions, like eval and exec, with that name. Are we committed to this name? -- nosy: +stev

[issue32945] sorted(generator) is slower than sorted(list-comprehension)

2018-02-25 Thread Steven D'Aprano
Steven D'Aprano added the comment: I think the difficulty here is that your perspective is backwards. It isn't that sorting a generator is *slower*, it is that sorting a list is *faster*, because there is more information available with a list and so the interpreter can take a

[issue32917] ConfigParser writes a superfluous final blank line

2018-03-10 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Sat, Mar 10, 2018 at 06:37:28AM +, TitanSnow wrote: > > TitanSnow added the comment: > > If we treat the original behavior as a bug, > it’s much easier to write a patch > that just changes the default behavior > and never

[issue33084] Computing median, median_high an median_low in statistics library

2018-03-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Fri, Mar 16, 2018 at 02:32:36PM +, Mark Dickinson wrote: > For what it's worth, NumPy gives a result of NaN for the median of an array > that contains NaNs: By default, R gives the median of a list containing either NaN or NA

[issue33089] Add multi-dimensional Euclidean distance function to the math module

2018-03-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: This was requested once before, but rejected. I would like to see that decision re-considered. https://bugs.python.org/issue1880 Some months ago, there was a very brief discussion started by Lawrence D’Oliveiro about this on the comp.lang.python news

[issue33089] Add multi-dimensional Euclidean distance function to the math module

2018-03-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: The obvious work-around of calling hypot multiple times is not only tedious, but it loses precision. For example, the body diagonal through a 1x1x1 cube should be √3 exactly: py> from math import hypot, sqrt py> hypot(hypot(1, 1), 1) == sqrt(3

[issue33089] Add multi-dimensional Euclidean distance function to the math module

2018-03-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: Ah wait, I appear to have misunderstood Raymond's request. Sorry Raymond! (I've been spending too much time teaching Pythagoras' theorem and my mind was primed to go directly from Euclidean distance to hypotenuse.) Not withstanding my

[issue33108] Unicode char 304 in lowercase has len = 2

2018-03-20 Thread Steven D'Aprano
Steven D'Aprano added the comment: It has never been the case that upper() or lower() are guaranteed to preserve string length in Unicode. For example, some characters decompose into a base plus combining characters. Ligatures are another example. See here for more details:

[issue28677] difficult to parse sentence structure in "When an instance attribute is referenced that isn't a data attribute"

2018-03-21 Thread Steven Downum
Change by Steven Downum : -- nosy: +steven.downum ___ Python tracker <https://bugs.python.org/issue28677> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33125] Windows 10 ARM64 platform support

2018-03-22 Thread Steven Noonan
New submission from Steven Noonan : The Windows 10 ARM64 release is out along with a bunch of ARM64 devices. This version of Windows has full support for building native Win32 applications (this isn't just some rehash of Windows RT). It also can run x86 (but not x86_64) apps un

[issue33125] Windows 10 ARM64 platform support

2018-03-22 Thread Steven Noonan
Steven Noonan added the comment: Oh, another change I had to make was remove all the BaseAddress elements in the Link sections. The linker complains if these are used (the lower 4GB of memory are apparently reserved for the x86 emulation). Also, from what I was told by someone over at

[issue33125] Windows 10 ARM64 platform support

2018-03-23 Thread Steven Noonan
Steven Noonan added the comment: I originally tagged this issue against 3.6 just because that's what I was attempting to build. But I'm not super concerned about what release these changes actually land in, I can always backport it to my own builds (and at my own risk). Even

[issue33125] Windows 10 ARM64 platform support

2018-03-23 Thread Steven Downum
Change by Steven Downum : -- nosy: +steven.downum ___ Python tracker <https://bugs.python.org/issue33125> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24356] venv documentation incorrect / misleading

2018-03-26 Thread Steven Downum
Change by Steven Downum : -- nosy: +steven.downum ___ Python tracker <https://bugs.python.org/issue24356> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33157] Strings beginning with underscore not removed from lists - feature or bug?

2018-03-27 Thread Steven D'Aprano
Steven D'Aprano added the comment: In addition to Xiang Zhang's comments, this is neither a feature nor a bug, but a misunderstanding. This has nothing to do with strings or underscores: py> L = [1, 2, 3, 4, 5] py> for item in L: ... L.remove(item) ... py> L [2, 4]

[issue33186] Memory corruption with urllib.parse

2018-03-30 Thread Steven D'Aprano
Steven D'Aprano added the comment: Alexey, I'm afraid I can't make heads or tails of your bug report. You've gone into a detailed description of the "bad results" you have, but you haven't explained *why* they're bad, or what you were expecting. I&

[issue31201] make test: module test that failed doesn't exist

2018-04-03 Thread Steven Downum
Change by Steven Downum : -- nosy: +steven.downum ___ Python tracker <https://bugs.python.org/issue31201> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32337] Dict order is now guaranteed, so add tests and doc for it

2018-04-03 Thread Steven D'Aprano
Steven D'Aprano added the comment: I started to add this comment to #33218 but Raymond closed that ticket while I was editing it. In 3.6, dicts preserving insertion order remains an implementation detail that cannot be relied on. It only becomes a guarantee in 3.7. Even in 3.7, I think

<    7   8   9   10   11   12   13   14   15   16   >