Steven D'Aprano added the comment:
> If you have to explain in a bpo issue how the doc should be read, that
> proves exactly my point that it's confusing. The fact that it's
> technically correct if you read it the right way is irrelevant.
Do you expect the docs t
Steven D'Aprano added the comment:
In addition to being a third-party library, according to the output you posted,
you're actually running Python 3.4 not 3.7.
--
nosy: +steven.daprano
___
Python tracker
<https://bugs.python.o
Steven D'Aprano added the comment:
> I'm sorry to say that you're wrong here.
I'm happy to be corrected.
It is fair to say I failed to take the multiple inheritance case into
account. Clearly super can't *only* look at the MRO of the first object
since
Steven D'Aprano added the comment:
> > What matters is the __mro__ attribute of the first argument. It matters
> because that is how the MRO actually is searched.
>
> By the way, if it was true (it is not),
Yes, I see that now.
> then what did you think was
>
Steven D'Aprano added the comment:
On Sat, Jun 08, 2019 at 09:14:18PM +, Raymond Hettinger wrote:
> Ideally, the text can also be made more compact. Having eight
> paragraphs sends an implicit message that this is too complex to
> understand and that it should be avoid
Steven D'Aprano added the comment:
> (message from a code of conduct violating troll deleted)
How did Bachsau violate the code of conduct, and what evidence do you
have that they were anything but 100% sincere in their comments?
>From where I am sitting, the only person violating
Steven D'Aprano added the comment:
Bachsau,
to respond to the substance of your comments: it is not the *primary*
purpose of a compiler to teach, but compiler warnings on potentially
wrong behaviour is a long-standing tradition in many languages,
including Python.
This is not the
Steven D'Aprano added the comment:
This looks like some sort of spam or joke.
There's no explanation given of what this enhancement does, the PR seems to add
only a rather suspicious looking triple-quoted string. (Possibly really bad
ASCII art of a finger?)
In the absence of any
Steven D'Aprano added the comment:
For the reasons already discussed on the Stackoverflow link you gave, Python
does not have pre- and post-increment and -decrement operators, and probably
never will.
I'm closing this ticket as Won't Fix, but if you wish to discuss it fu
Steven D'Aprano added the comment:
Support for "~" isn't strictly part of the POSIX file system standard, it is a
*shell* shortcut. As far as the file system is concerned, "~" is just a regular
character like any other.
--
Steven D'Aprano added the comment:
It is a *syntax* error. You have written bad syntax, just as the error message
says. Your \xXX code is too short, only 1 hex digit instead of 2. I disagree
that this should be a value error: it isn't a bad value, it is bad syntax.
I don'
Steven D'Aprano added the comment:
Could you supply a *simple* demonstration of a class showing this problem? I've
looked at the uploaded "test6.py" (what happened to the other 5?) and don't see
anything to do with either __getattr__ or property in it.
---
Steven D'Aprano added the comment:
I don't think that will work. If the user passes a non-string which is falsey,
your patch will attempt to write it directly to the stream without converting
it to a string.
Try ``_raw_input(0)`` as an example.
Tal Einat:
> one would expect p
Change by Steven D'Aprano :
--
nosy: +steven.daprano
___
Python tracker
<https://bugs.python.org/issue37454>
___
___
Python-bugs-list mailing list
Unsubscr
Steven D'Aprano added the comment:
Here are links to the relevant docs:
https://docs.python.org/3/library/stdtypes.html#str.startswith
https://docs.python.org/3/library/stdtypes.html#str.endswith
Both say:
"With optional *start*, test string beginning at that position. With opti
Steven D'Aprano added the comment:
Perhaps it would help if we spelled out the behaviour more explicitly?
str.startswith(prefix[, start=0[, end=len(string)]])
Return True if the slice of string between start (defaults to the beginning
of the string) and end (defaults to the end o
Steven D'Aprano added the comment:
> it would be better for an exception to be thrown rather than creating a
> corrupt folder.
I am not convinced that Python should refuse to create a perfectly valid
directory because some components of Windows sometimes have trouble resolving
t
Steven D'Aprano added the comment:
Eric is correct that this is a CPython optimization, it is not a language
feature.
Furthermore, it is an optimization that can be affected by rather subtle
factors such as the operating system memory management. Here is a thread
demonstrating that
Steven D'Aprano added the comment:
For future reference, please don't post screen shots of plain text, as they
make it unnecessarily difficult for blind or visually impaired developers to
contribute (and yes, they do exist, I've worked with some, and at least one
core devel
New submission from Steven D'Aprano :
See #37515.
Perhaps Windows builds can check for reserved file names and give a more
descriptive error message in the event of IO error?
(Eryksun also mentions two reserved names which Microsoft apparently does not
document: "CONIN$&qu
Change by Steven D'Aprano :
--
type: -> enhancement
___
Python tracker
<https://bugs.python.org/issue37517>
___
___
Python-bugs-list mailing list
Unsub
Steven D'Aprano added the comment:
The behaviour and error message is correct, and your interpretation is
incorrect. You are not assigning to a closure variable on line 4; you are
printing an unbound local variable on line 3, precisely as the error message
says. That may not match
Steven D'Aprano added the comment:
To clarify further, unlike (say) Lua, Python doesn't allow variables to change
scope part-way through a function. (At least not without hacking the
byte-code.) In any function, a name refers to precisely one of (1) a local, (2)
a nonlocal, and (3
Steven D'Aprano added the comment:
Seems to have been created in error.
--
nosy: +steven.daprano
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.pyth
Steven D'Aprano added the comment:
You say this is a problem affecting *Mac* users, but all of your examples show
*Windows* paths. How do you know it affects Macs?
You say that get_python_lib() returns the incorrect path, but you don't show us
the output of calling get_python_lib
Steven D'Aprano added the comment:
A new language feature like this needs to be discussed on Python-Ideas first,
to get community feedback, to decide whether the feature is desired by the
community, to iron-out any bugs in the specification, and decide whether or not
you will need to
Steven D'Aprano added the comment:
Oops, I accidentally removed xtreak, and then aeros167 accidentally removed me.
--
nosy: +steven.daprano, xtreak
type: -> enhancement
___
Python tracker
<https://bugs.python.org
Steven D'Aprano added the comment:
What leads you to believe that eval *shouldn't* work in the global scope in a
comprehension?
If not the global scope, which scope should it be, local or nonlocal? Is the
behaviour documented differently?
For reference, the current docs for eva
Steven D'Aprano added the comment:
I have a query about the documentation:
The default *method* is "exclusive" and is used for data sampled
from a population that can have more extreme values than found
in the samples. ...
Setting the *method* to "in
Steven D'Aprano added the comment:
I'm not sure we should be so quick to close this. At the very least, I
think the documentation could be improved.
It does seem desirable to have the invariant:
`expression` == `eval("expression")`
apply in any environment. Was the
Steven D'Aprano added the comment:
Both 3.7 and 3.8 are in feature-freeze, so the earliest we can get this would
be 3.9.
But before that, we have to decide on what reversing a reversed object means.
it = reversed([1, 2, 3, 4])
next(it)
list( reversed(it) )
Should that give [1, 2, 3]
New submission from Steven D'Aprano :
As per the discussion here, let's deprecate unbound super methods.
https://discuss.python.org/t/is-it-time-to-deprecate-unbound-super-methods/1833
--
messages: 349338
nosy: steven.daprano
priority: normal
severity: normal
status:
New submission from Steven D'Aprano :
As discussed in the thread starting here with Guido's message:
https://mail.python.org/archives/list/python-id...@python.org/message/WTBXYJJ7CSGDLLJHHPHSH5ZCCA4C7QEP/
and these two follow-ups:
https://mail.python.org/archives/list/python-id...@
Steven D'Aprano added the comment:
bools are integers, specifically they are a subclass of int:
py> isinstance(True, int)
True
py> issubclass(bool, int)
True
so the behaviour is correct.
--
nosy: +steven.daprano
resolution: -> not a bug
stage: -> resolved
statu
Steven D'Aprano added the comment:
I don't understand what you actually are requesting here.
Are you requesting a way to tell whether or not the filename is too long?
You've already been told that the way to do that is to check errno, and you say
that you already knew t
Steven D'Aprano added the comment:
I don't think graphemes is the right term here. Graphemes are language
dependent, for instance "dž" may be considered a grapheme in Croatian.
https://en.wikipedia.org/wiki/D%C5%BE
http://www.unicode.org/glossary/#grapheme
I believe
Steven D'Aprano added the comment:
http://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries
talks about *grapheme clusters*, not "graphemes" alone, and it seems clear to
me that they are language dependent. For example, it says:
The Unicode Standard provides default
New submission from Steven D'Aprano:
Unicode 10.0 is now finalized:
http://blog.unicode.org/2017/06/announcing-unicode-standard-version-100.html
It would be good if Python 3.7 would support it. (I think that Python currently
supports Unicode 8?)
--
messages: 296630
Steven D'Aprano added the comment:
This is a bug in your code, not Python, and the error tells you how to fix it.
You have to indent the block.
>>> while b < 1000:
... print(b, end=',')
... a, b = b, a+b
Remember to press TAB or spacebar inside indent
Changes by Steven D'Aprano :
--
nosy: +steven.daprano
___
Python tracker
<http://bugs.python.org/issue30772>
___
___
Python-bugs-list mailing list
Unsubscr
New submission from Steven D'Aprano:
As discussed on Python-Ideas, there's some interest in a context manager that
can convert an exception from one type to another (similarly to the way PEP 479
has StopIteration converted to RuntimeError.
See the thread starting here:
https://mail.
Steven D'Aprano added the comment:
I think that the names in __all__ should have the same NFKC normalisation
applied as the identifiers.
Re-opening for 3.7.
--
resolution: not a bug ->
stage: resolved ->
status: closed -> open
title: If I make an attribute " -&g
Steven D'Aprano added the comment:
Although I'm not German, I'm rather pleased by this. Nevertheless I don't think
we actually need to do anything yet.
I think it is more important that Python follows the standard Unicode
behaviour. If and when Unicode recommend that
Steven D'Aprano added the comment:
> Using "round(number[, digits])" in a program I get no rounding
It works for me. Can you show an example of it not working?
py> round(1.23456789012345, 3)
1.235
> Using the same command in the terminal interpreter it returns
> .
Steven D'Aprano added the comment:
Please copy and paste (don't retype from memory!) the *exact* error you are
getting.
You should be seeing something like:
SyntaxWarning: name 'current_user' is used prior to global declaration
(at least that's the warning I'm
Changes by Steven D'Aprano :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.pyth
Steven D'Aprano added the comment:
Before Python runs your code, it compiles it to byte-code. A SyntaxError means
that the code cannot be compiled, and so it does not run.
So the SyntaxError is raised *before* any of the code runs, and standard error
is not re-directed. This is exp
Steven D'Aprano added the comment:
Also, for the future, please do not post screen shots of text. Copy and Paste
the text from the console. Thank you.
--
nosy: +steven.daprano
___
Python tracker
<http://bugs.python.org/is
Steven D'Aprano added the comment:
Thank you, but I cannot review your C code.
Can you start by telling us what the two functions:
unicodedata.grapheme_cluster_break()
unicodedata.break_graphemes()
take as arguments, and what they return? If we were to call
help(function), what would w
Steven D'Aprano added the comment:
This is not a bug. Whether Python allocates one, or two, float objects for a
particular floating point value is dependent on the implementation and not a
language guarantee. The language does not promise that two floats with the
value 7.3 will be the
Steven D'Aprano added the comment:
Python 3.4, 3.5 and 3.6 are in feature-freeze, so this enhancement can only
apply to 3.7.
You say that pathlib.Path "can't be subclassed", but then immediately show an
example of subclassing it:
>>> class MyPath(pathlib.Path):
Steven D'Aprano added the comment:
Apart from being "cool", what is the purpose of this key argument?
For the example shown, where you extract an item from tuple data:
>>> median_low([(1, 2), (3, 3), (4, 1)], key=lambda elem: elem[0])
(3, 3)
I'm not sure I under
Steven D'Aprano added the comment:
> This means that a user who wishes to use '--' in some other way is out of
> luck.
I think that's a feature, not a limitation.
Command line arguments should use broadly consistent conventions. I don't want
one program to us
Steven D'Aprano added the comment:
Thanks for explaining your use-case.
Although the median_* functions don't perform arithmetic on their data,
they are still conceptually mathematical functions that operate on
numbers and I'm reluctant to support arbitrary objects with
Steven D'Aprano added the comment:
I've given this some more thought, and I think that a "key" argument
would make sense for a general selection function.
The general selection problem is: given a set of items A, and a number k
between 1 and the number of items, retu
Steven D'Aprano added the comment:
In the future, please do not post screenshots, please copy and paste the text.
Screenshots are hard or impossible for the blind or visually impaired to see,
but they can use a screen reader to work with text.
--
nosy: +steven.da
Steven D'Aprano added the comment:
If you don't care about the name, just pass '_' for it.
--
nosy: +steven.daprano
___
Python tracker
<http://bug
Steven D'Aprano added the comment:
On Thu, Aug 03, 2017 at 11:21:38AM +, Serhiy Storchaka wrote:
> Should iterators provide just substrings or their positions?
[...]
I think we're breaking new ground here and I'm not sure what the right
API should be. Should we fol
Steven Winfield added the comment:
I've just been bitten by this on 3.6.2, Windows Server 2008 R2, when running
the setup.py script for QuantLib-SWIG:
https://github.com/lballabio/QuantLib-SWIG/blob/v1.10.x/Python/setup.py
It seems there is different behaviour depending on whether:
*
Steven D'Aprano added the comment:
I'm afraid your error report isn't completely clear. What do you mean "input
single quote in print"? Do you mean this?
print(')
You say IDLE "crashed". What do you mean? Do you mean the IDLE application put
up a
Steven D'Aprano added the comment:
This seems like a reasonable enhancement to `sum` to me.
Since 2.7 is in feature freeze, this can only apply to 3.7.
--
nosy: +steven.daprano
type: behavior -> enhancement
versions: -Python 2.7
___
Python
Steven D'Aprano added the comment:
I'm not sure whether this is a bug or a feature.
In the examples you show, we have *both* an IndentationError/TabError and
missing parentheses around print. So I'm almost inclined to say that this is
right:
- you get an IndentationErr
Steven D'Aprano added the comment:
> > Perhaps the check needs to be limited to just the exact type.
> Looks reasonable to me. Do you want to provide a PR Martijn?
You realise that is making the current traceback *less* informative
instead of more informative? I think that
Steven D'Aprano added the comment:
I agree that returning type(self) or self.__class__ (not sure which is better)
is the right thing to do.
It might be possible to argue that the Python version is buggy, if the C
version is treated as the reference implementation and the Python versio
Steven D'Aprano added the comment:
I don't think this is a bug, I think it is standard behaviour which should be
expected if you think about Python's execution model. If you inherit from
object implicitly:
class Spam: ...
then the interpreter gets to pick the base class,
Steven D'Aprano added the comment:
> the documentation states that the two examples I gave should yield identical
> results.
Got a link to the specific documentation that says this? And a suggested
improvement?
--
assignee: -> docs@python
components: +Documentati
Steven D'Aprano added the comment:
> When using nested SimpleNamespaces, a making a copy by using
>
> new_NS=SimpleNamespace(**namespace.__dict__.copy())
In general, you shouldn't call or directly access dunder attributes.
There are exceptions, but generally they'
Steven D'Aprano added the comment:
The demo code you give seems to be working perfectly correctly. I don't think
anything here is a bug.
(1) You are working with a dict, not a tuple.
(2) The potint.__repr__ method does NOT have a bug.
(3) de['four'] is NOT an int, it is a
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(),
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 "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
___
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:
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:
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:
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:
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
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:
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
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:
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:
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:
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:
> > 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 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:
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:
> 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:
> 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:
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:
> 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:
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:
> 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:
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:
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:
> 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:
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:
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:
> 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:
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:
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:
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
901 - 1000 of 1942 matches
Mail list logo