Steven D'Aprano added the comment:
Python 2.7 is (almost) end of life and well beyond feature-freeze, so this can
only go into 3.8 or better.
Since the paths logged are relative to the current working directory, perhaps
you could just have your script log the working dire
Steven D'Aprano added the comment:
These proposals probably should be discussed on Python-Ideas first. You should
also familiarize yourself with previous proposals to enhance range, such as
https://mail.python.org/pipermail/python-ideas/2018-November/054510.html
and the bug report #
Steven D'Aprano added the comment:
One more thing: if you intend to proceed with this, either as individual
enhancements or a PEP, you should discuss them on the Python-Ideas mailing list
first, to see how much or little community support the proposals have.
Until then, I'm closi
Steven D'Aprano added the comment:
Do you have agreement from the maintainer(s) of Coconut that they are willing
to put Coconut into the Python language and/or std library?
Given that Coconut is effectively a radically different language from Python (a
superset of Python) this is
Steven D'Aprano added the comment:
Please provide a proper reproducible bug report. Don't make us GUESS what
function you are referring to.
I don't know any "splitextTest" function that you describe in the bug report
title. Do you mean os.path.splitext? Then you sh
Steven D'Aprano added the comment:
What is the module "cookiejar" you are importing? Is that a third-party module?
It doesn't seem to be in the standard library. There is a module
`http.cookiejar` but it doesn't seem to have an `is_HDN` function.
If this is a th
Steven D'Aprano added the comment:
Here's my implementation:
from unicodedata import name
from unicodedata import lookup as _lookup
from fnmatch import translate
from re import compile, I
_NAMES = None
def getnames():
global _NAMES
if _NAMES is None:
_NAMES = []
Steven D'Aprano added the comment:
I love the idea, but dislike the proposed interface.
As a general rule of thumb, Guido dislikes "constant bool parameters", where
you pass a literal True or False to a parameter to a function to change its
behaviour. Obviously this is
Steven D'Aprano added the comment:
> I'll keep on finding "-> string or unicode" misleading.
How is it misleading when its true?
--
___
Python tracker
<https
Steven D'Aprano added the comment:
Encoding and decoding, in the most general sense, can include unicode ->
unicode and bytestring -> bytestring.
I can't see any standard unicode->unicode encodings in Python 2.7
https://docs.python.org/2/library/codecs.html
but we
Steven D'Aprano added the comment:
On Wed, Dec 19, 2018 at 10:37:22AM +, Mark Dickinson wrote:
>
> Mark Dickinson added the comment:
>
> The call to `logging.error` is *not* irrelevant here. It's causing an
> implicit, and surprising (albeit documented), call t
Steven D'Aprano added the comment:
> That's true. Maybe and warning or Exception can be raise?
Why would we raise a warning or exception for expected behaviour?
logging.error() and some_instance.error() don't necessarily produce the
same output. What would the exception sa
Steven D'Aprano added the comment:
The call to logging.error() is irrelevant, since there's no expectation that
the module-level function will necessarily output the same as a method of a
specific instance logger.error().
I agree that is it quite curious that the first call to lo
Steven D'Aprano added the comment:
In the future, please describe your problem here, on the bug tracker, not just
by linking to Stackoverflow.
You asked:
"Why is the file creation time [less than] the time measured before it is
created?"
(You actually say "greater th
Steven D'Aprano added the comment:
> See attached script, which is self-explanatory.
I'm glad one of us thinks so, because I find it clear as mud.
I spent *way* longer on this than I should have, but I simplified your sample
code to the best of my ability. (See attached.) As
Steven D'Aprano added the comment:
I asked:
> > Are you suggesting we need new syntax to automatically assign docstrings
> > to instances?
Stefan replied:
> No, I'm not suggesting that.
And then immediately went on to suggest new syntax for automatically
bindi
Steven D'Aprano added the comment:
> Is there any discussion concerning what syntax might be used for
> docstrings associated with objects ?
I don't know about PyDoc in general, but I would expect help(obj) to
just use obj.__doc__ which will return the instance docstring if
Steven D'Aprano added the comment:
Minor note on terminology: classes and functions are themselves objects.
I think that help() (or in particular PyDoc in general) should support any
instance with a __doc__ attribute. Its failure to do so is causing pain, see
#12154.
--
Steven D'Aprano added the comment:
> I see nothing wrong with adding Tail Call Optimization to Python.
That's nice. Is that supposed to be an argument that convinces us?
You are hardly the first person ever to suggest TCO for Python:
https://duckduckgo.com/?q=tail+call+opti
Steven D'Aprano added the comment:
> Any ideas? Or I will create a PR in a week without 'CPython implementation
> detail'
I don't think we want to give any stability guarantees for this. Perhaps
we should explicitly state that this is not guaranteed behaviour and
Steven D'Aprano added the comment:
Brett, what was the purpose of the title change?
> title: The math module should provide a function for computing
> binomial coefficients -> Add a function for computing binomial
> coefficients t
Steven D'Aprano added the comment:
On Fri, Dec 07, 2018 at 01:37:36PM +, Mark Dickinson wrote:
> I'd personally prefer that floats not be accepted;
Agreed. We can always add support for floats later, but its hard to
remove it if it turns out to be problematic.
We ought to
Steven D'Aprano added the comment:
> > Mathematically, `binomial(n, k)` for `k > n` is defined as 0.
>
> It's not so clear cut. You can find different definitions out there.
> Knuth et. al., for example, in the book "Concrete Mathematics", extend
> t
Steven D'Aprano added the comment:
On Fri, Dec 07, 2018 at 12:04:44AM +, Raymond Hettinger wrote:
> Also, I'm not sure what the predominant choice for variable names
> should be, "n things taken r at a time" or "n things taken k at time".
>
>
Steven D'Aprano added the comment:
Documentation is available for all versions going back to Python 1.4.
https://docs.python.org/release/1.4/
As it should be: I'm surely not the only person who has need to check old
versions of the documentation from time to time. Not everyone is
Steven D'Aprano added the comment:
You import reduce but never use it :-)
+1 for this, I certainly miss it too.
--
nosy: +steven.daprano
___
Python tracker
<https://bugs.python.org/is
Steven D'Aprano added the comment:
This is for reporting bugs in the Python interpreter and standard library, not
for asking for help with bugs in your own code.
The code you show contains a syntax error (some of the indentation is wrong)
and at least one undefined variable, "
Steven D'Aprano added the comment:
Python 3.7 is in feature-freeze, so any new features like this will have to be
3.8 only.
--
nosy: +steven.daprano
versions: -Python 3.7
___
Python tracker
<https://bugs.python.org/is
New submission from Steven D'Aprano :
The urllib.parse module contains an undocumented function unwrap:
unwrap('') --> 'type://host/path'
This is useful. I've been re-inventing this function in many of my scripts,
because I didn't know it exist
Steven D'Aprano added the comment:
I'm changing the name to better describe the problem, and suggest a better
solution.
The urlparse.urlsplit and .urlunsplit functions currently don't validate the
scheme argument, if given. According to the RFC:
Scheme names consist o
Steven D'Aprano added the comment:
You haven't given a convincing reason that there is a problem that needs
fixing, or if there is, that your patch is the right way to fix it.
You have already pointed out that there is at least one scheme where :/// is
part of a valid URL: "f
Steven D'Aprano added the comment:
Also, for future reference, please spend the time to make a good bug report,
showing the minimum code needed to reproduce the error, and the full error, not
just a summary.
Please read this before your next bug report:
http://sscce.org/
Than
Steven D'Aprano added the comment:
I don't think this is broken, but I do think it could be documented better. You
have to read the documentation for `urlparse` to see this:
[Quote]
Following the syntax specifications in RFC 1808, urlparse recognizes a netloc
only if it i
Steven D'Aprano added the comment:
Looks like we have a stand-off between core devs, and no BDFL to make a ruling.
There is support for the feature from at least Barry and Raymond (although I
think Guido was cool on the idea, maybe?). Gregory, do you feel strongly enough
about this
Steven D'Aprano added the comment:
What "freegrammar" symbol are you referring to?
Why should it be made static or renamed?
2.7 is something like a decade old now, why do you describe this as a new
symbol?
--
nosy: +steven.daprano
___
Change by Steven D'Aprano :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.pyth
Steven D'Aprano added the comment:
Raymond:
> I'm in agreement with the comments that the proposed __str__ revision is
> confusing.
In what way is it "confusing"?
I'm especially perplexed that Julien apparently thinks it is confusing when
emitted by str(),
Steven D'Aprano added the comment:
On Sun, Nov 18, 2018 at 10:27:11PM +, Julien Palard wrote:
>
> Julien Palard added the comment:
>
> If I understand correctly, you'd like str(range(10)) to return " [1, 2, ..., 8, 9]>"?
Exactly the same as you sugg
Steven D'Aprano added the comment:
I'm afraid I can't reproduce that in Python 3.5.2 or 3.6.4.
Can you try this?
from time import time
print(time(), '\x98', time()); print(time())
and copy and paste the results.
What terminal/console are you using? If you chan
Steven D'Aprano added the comment:
On Sun, Nov 18, 2018 at 09:43:02PM +, Julien Palard wrote:
> My first though went to giving something really simple like:
>
> >>> print(range(10))
> 1, 2, ..., 8, 9
-1
Surely that would be your *second* thought, since yo
Steven D'Aprano added the comment:
I don't understand what you think is the bug. You keep repeatedly appending 'z'
to the same list. Why are you surprised that it appends 'z' more than once? If
you don't want to append it twice, don't call the
Steven D'Aprano added the comment:
> l2 = [str(leaf) for leaf in tree for tree in forest]
Expanded to nested loops, that becomes:
l2 = []
for leaf in tree:
for tree in forest:
l2.append(str(leaf))
which of course gives a NameError, because you are trying to iterate over
Change by Steven D'Aprano :
--
nosy: +steven.daprano
___
Python tracker
<https://bugs.python.org/issue35224>
___
___
Python-bugs-list mailing list
Unsubscr
Steven D'Aprano added the comment:
https://docs.python.org/3/library/venv.html
> my students are often confused by it, sometimes they copy the angle brackets,
> sometime even the prompt.
Learning to recognise placeholders and the prompt is an essential part of
learning to code,
Steven D'Aprano added the comment:
> I've never seen any student try `str(range(10))` in the repl
I never suggested that students would try calling str() directly. That
would be silly. They would use print(), as I'm sure many of them are
already doing.
After 20+ years
Steven D'Aprano added the comment:
With the proposed design, any two empty range objects have the same repr:
repr(range(0)) == repr(range(2, 2)) == repr(range(1, 5, -1)) etc.
Between this loss of information, and the loss of round-tripping through eval,
I'm against this proposa
Steven D'Aprano added the comment:
Not everyone knows the '...' convention. At least according to Google's
predictive search, if I type "what does three dots" I get common searches such
as "what does three dots mean at the end of a sentence" and simila
Steven D'Aprano added the comment:
This is not a bug, this is standard behaviour, working as designed.
'a' is not a copy of the list 'x', 'a' is another name for the same list as
'x'. Any in-place modifications you make to 'a' ha
Steven D'Aprano added the comment:
How weird... after restarting the interpreter, I can't reproduce that
TypeError. I get the AssertionError Serhiy showed.
--
___
Python tracker
<https://bugs.python.o
Steven D'Aprano added the comment:
You say it doesn't work as expected, but you don't say what you expect or why.
(Don't make me guess what you mean -- explicit is better than implicit.)
When I try your subclass in 3.6, I get an unexpected TypeError:
py> class Dict(
Steven D'Aprano added the comment:
https://docs.python.org/3/reference/expressions.html#attribute-references
__getattr__ is the correct method to override in most (but not all) cases. I
don't think we should encourage people to override __getattribute__ as the
fi
Steven D'Aprano added the comment:
This is not a bug in Python, it is an invalid (broken) regular expression.
There is nothing that the interpreter or the regular expression engine can do,
because you are telling it to do something that makes no sense. What do you
expect findall to fin
Steven D'Aprano added the comment:
I think this is being excessively prescriptive and solving a problem that isn't
a problem.
But perhaps if you start by proposing a concrete style guide, I can judge
better.
--
nosy: +steven.daprano
Steven D'Aprano added the comment:
I was not aware that there currently were arguments about the use of sentinels
in future code. I feel that you are being excessively prescriptive here:
"we should nip it in the bud"
is good advice for gardening, but for programming it just r
Steven D'Aprano added the comment:
There is no need to split the relevant code into a third-party website,
especially when it is so small and can be included in-line here.
Python 2.7:
py> import distutils.version
py> distutils.version.LooseVersion('7') > distutils.
Steven D'Aprano added the comment:
> Its quite valid to assign to __new__ to replace the behavior of how an
> instance is created.
Of course it is, and I never argued otherwise.
> Finally as for `Color.__x__` assignment, this has nothing to do with
> `__slots__` as i
Steven D'Aprano added the comment:
I think the real WTF here is that you can write to arbitrary dunder attributes
even if they aren't listed in __slots__.
py> Color.__NOBODY_expects_the_Spanish_Inquisition__ = "What?"
py> Color.__NOBODY_expects_the_Spanish_Inquisiti
Change by Steven D'Aprano :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.pyth
Steven D'Aprano added the comment:
What do you mean, a crash report?
You get a traceback telling you the problem: the file is missing. What
behaviour did you expect if you try to decode a non-existent file?
Perhaps you meant to write:
python3 -m base64 -t "12s345a2"
I don&
Steven D'Aprano added the comment:
Yes, that's exactly right. That's how local variables work in Python:
x = 999 # global x
def demo():
if False:
x = 1
x # local x has no value
does the same thing. This is standard, documented behaviour, regardless
of which kin
Steven D'Aprano added the comment:
Stéphane, I'm curious why you asked for a pastebin when James already provided
the code right here in the tracker? (Your email even included a copy of that
code.) Why split the information into anoth
Steven D'Aprano added the comment:
This is expected behaviour: import is a form of assignment.
"import logging", like "logging = 1", tells the compiler to treat logging as a
local variable (unless you declare logging as global). As the exception says,
you are try
Steven D'Aprano added the comment:
> And you are free to use whatever sorting algorithms in its implementation for
> this kind of task.
That's very kind of you *wink*
At this point, I don't think there's much more point to discussing this further
until Tim Peters
Steven D'Aprano added the comment:
The ``sorted`` docs links to the Sorting HOWTO, the ``list.sort`` docs should
do the same.
https://docs.python.org/3/library/functions.html#sorted
https://docs.python.org/3/library/stdtypes.html#list
Steven D'Aprano added the comment:
Since sort is guaranteed to be stable, can't you sort in two runs?
py> values = ['bc', 'da', 'ba', 'abx', 'ac', 'ce', 'dc', 'ca', 'aby']
py> values.so
Steven D'Aprano added the comment:
I don't know what you mean by "referential integrity data loss".
I have absolutely no idea how to interpret the wall of output you have
provided. If there is a bug here, how do you know it is a language bug rather
than a bug in your
Steven D'Aprano added the comment:
On Wed, Oct 10, 2018 at 05:11:01AM +, Serhiy Storchaka wrote:
> I don't think that it is necessary to state its format. It is an
> opaque dictionary, and its format is an implementation detail.
There is at least one use-case for wanti
New submission from Steven D'Aprano :
The warnings module makes use of a per-module global ``__warningregister__``
which is briefly mentioned in the docs but not documented.
https://docs.python.org/3/library/warnings.html#warnings.warn_explicit
Given that it is part of the warn_explici
Steven D'Aprano added the comment:
We match the Unicode specification, not arbitrary language rules. (Austrian and
Swiss German are, I believe, phasing out ß altogether, and haven't added an
uppercase variant.)
Until the Unicode consortium change their case conversion rules, i
Change by Steven D'Aprano :
--
nosy: +steven.daprano
___
Python tracker
<https://bugs.python.org/issue28716>
___
___
Python-bugs-list mailing list
Unsubscr
Steven D'Aprano added the comment:
I want to revisit this for 3.8.
I agree that the current implementation-dependent behaviour when there are NANs
in the data is troublesome. But I don't think that there is a single right
answer.
I also agree with Mark that if we change median, w
Steven D'Aprano added the comment:
I don't like the idea of adding a second bool parameter to splitlines. Guido
has a rough rule of thumb (which I agree with) of "no constant bool
parameters". If people will typically call a function with some sort of "mode"
Steven D'Aprano added the comment:
For future reference, please don't post unnecessary screen shots and images.
Code is text, please copy and paste it as text, not as pixels.
Images make it difficult or impossible for the blind and visually impaired to
contribute.
-
Steven D'Aprano added the comment:
> And, I think a broader discussion on python-dev might be useful, too, in
> order to get more opinions.
Done:
https://mail.python.org/pipermail/python-dev/2018-October/155410.html
Changing the status to Pending until we have more clarity on w
Steven D'Aprano added the comment:
On Wed, Oct 03, 2018 at 01:56:00PM +, Eric V. Smith wrote:
> I think this is a bug that should be fixed.
Supporting this position, shadowing other exceptions doesn't change the
exception generated by the interpreter:
py> TypeError =
Steven D'Aprano added the comment:
On Wed, Oct 03, 2018 at 09:49:06AM +, thautwarm wrote:
> Steven, this problem is quite interesting because it just allows users
> to cause fatal errors without any invalid operations.
How is that different from every other case of shadowin
Steven D'Aprano added the comment:
If I have understood you correctly, you are asking whether it is expected
behaviour for assert to use the global AssertionError instead of the built-in
AssertionError.
I don't see why it shouldn't. In any case, that behaviour goes back to
Steven D'Aprano added the comment:
Please move the "chaos" discussion to #34867
--
___
Python tracker
<https://bugs.python.org/issue34850>
___
___
New submission from Steven D'Aprano :
Split off from #34850 by Guido's request.
To help catch incorrect use of `is` when `==` is intended, perhaps we should
add an interpreter mode that disables the caches for small ints and interned
strings.
Nathaniel called it "chaos mo
Steven D'Aprano added the comment:
On Sun, Sep 30, 2018 at 10:24:41PM +, Nathaniel Smith wrote:
> Would it make sense to implement a "chaos" mode (that e.g. testing
> tools could enable unconditionally), that disables the small integer
> and small string caches?
Steven D'Aprano added the comment:
I like this solution of a syntax warning for `is ` and I agree that
`== None` should not be a warning.
(And for what its worth, I strongly disagree with making `is` a hybrid
sometimes-check-identity-sometimes-check-equality operator.)
--
Steven D'Aprano added the comment:
``pip3 search multiprocessing`` says:
multiprocessing (2.6.2.1)- Backport of the multiprocessing package
to Python 2.4 and 2.5
so you are trying to install a Python 2.4/2.5 package into Python 3.7, which
naturally cannot work.
In Pytho
Change by Steven D'Aprano :
--
nosy: +steven.daprano
___
Python tracker
<https://bugs.python.org/issue34763>
___
___
Python-bugs-list mailing list
Unsubscr
Steven D'Aprano added the comment:
Versions 3.7 and below are all in feature-freeze, so this change could only
apply to 3.8 and above.
I don't know if this feature is desirable or not.
If it is (sometimes?) desirable, my guess is that it would be undesirable to
use SUDO_USER *u
Steven D'Aprano added the comment:
> Well, the thing is that i pass two (apparent) identical values into the same
> function,
Even if they have the same *numeric* value, they aren't the same kind of
value, and they aren't the same function.
One is and the othe
Steven D'Aprano added the comment:
Oops, sorry, I mistyped. I said:
So there's a problem. You're trying to raise a negative number
to a positive value
I meant to say a *fractional* value. Sorry for the confusion.
--
___
Steven D'Aprano added the comment:
Your code gives runtime warnings of invalid values. You should fix that. If
your values are invalid, there's probably a bug in your code.
RuntimeWarning: invalid value encountered in double_scalars
Your code is also very complex. You ought to si
Steven D'Aprano added the comment:
This is not a bug or a syntax error, and the behaviour goes back to at least
Python 1.5 if not older.
List.reverse returns a reference to the method object itself. List.reverse()
*calls* the method. This is standard behaviour in Python, all method
Steven D'Aprano added the comment:
For what its worth, I'm +1 with Serhiy that we raise an exception
on a non-string argument, including the case where the caller forgets to
provide a reason at all.
I don't think that @skip with no reason was ever intended to work (it
c
Steven D'Aprano added the comment:
I strongly disagree with this as a general principle.
"Master/slave" is a powerful, obvious metaphor which works well and is not the
same as parent/child, server/client or employer/worker.
In fact, in the BDSM subcultures, "master/slave
Steven D'Aprano added the comment:
Is there a use-case for reason to be anything but a string?
--
nosy: +steven.daprano
___
Python tracker
<https://bugs.python.org/is
Steven D'Aprano added the comment:
Thanks for confirming the seg fault. I've changed this to a crasher.
Should we change the exception to RuntimeError?
--
components: +Library (Lib) -Extension Modules
type: behavior -> crash
___
P
Steven D'Aprano added the comment:
I've tried running this code in Python 3.6:
from _struct import Struct
for i in range(10):
L = [Struct.__new__(Struct) for j in range(1000)]
for s in L:
try:
x = s.pack_into(bytearray())
except S
Steven D'Aprano added the comment:
_struct is a private implementation detail. You shouldn't use it. You shouldn't
care where the implementation "really is" in your Python code, because it could
move without warning. There are no backwards-compatibility guarantees
Steven D'Aprano added the comment:
This exception goes back to at least Python 2.6 (if not older) but I'm not
convinced it is a bug.
Calling __new__ alone is not guaranteed to initialise a new instance
completely. The public API for creating an instance is to call the class obje
Change by Steven D'Aprano :
--
nosy: +steven.daprano
___
Python tracker
<https://bugs.python.org/issue34483>
___
___
Python-bugs-list mailing list
Unsubscr
Steven D'Aprano added the comment:
You wrote:
> There are 6 bytes not 4 and where did the c3, bd, and c2 come from?
In Python 2, strings are byte strings, in Python 3, strings by default are
Unicode text strings. You are seeing the UTF-8 representation of the text
string.
py>
Change by Steven D'Aprano :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.pyth
Steven D'Aprano added the comment:
I don't think the description you give is very accurate. The description in the
file splat.py says:
"Hangs/core dumps Python2 when instantiated"
(which is it? hang or core dump?)
but I can't replicate that. Instantiating A() i
Steven D'Aprano added the comment:
Sorry, this is for reporting bugs in the Python interpreter and standard
library, not your own code. If you have a bug in your pyinator project, you
should report it to yourself, not us :-)
If you think my analysis of the problem below is wrong, and
801 - 900 of 1443 matches
Mail list logo