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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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:
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
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
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
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
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
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
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
Change by Steven D'Aprano :
--
nosy: +steven.daprano
___
Python tracker
<https://bugs.python.org/issue36259>
___
___
Python-bugs-list mailing list
Unsubscr
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
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
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
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
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
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
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
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
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.
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
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
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
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
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().
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
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
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
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
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__(
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().&
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
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
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.
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
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
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
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
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
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
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
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
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
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.
-
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
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'
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
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
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/
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
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
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
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
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
&
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
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
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
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
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
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
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
Change by Steven D'Aprano :
--
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue32778>
___
___
Python-bugs-
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
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
Steven D'Aprano added the comment:
What makes the minimum mode better than the maximum?
--
___
Python tracker
<https://bugs.python.org/issue28956>
___
___
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
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
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
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.
--
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
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
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
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
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
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
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
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:
Change by Steven Downum :
--
nosy: +steven.downum
___
Python tracker
<https://bugs.python.org/issue28677>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
Change by Steven Downum :
--
nosy: +steven.downum
___
Python tracker
<https://bugs.python.org/issue33125>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Steven Downum :
--
nosy: +steven.downum
___
Python tracker
<https://bugs.python.org/issue24356>
___
___
Python-bugs-list mailing list
Unsubscribe:
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]
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&
Change by Steven Downum :
--
nosy: +steven.downum
___
Python tracker
<https://bugs.python.org/issue31201>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
1101 - 1200 of 1942 matches
Mail list logo