Steven D'Aprano added the comment:
I've assumed that the documentation is correct, and that "%s"%obj should call
__str__ for unicode objects as well as everything else.
Attached in a test file.
--
Added file: http://bugs.python.org/file16595/t
Steven D'Aprano added the comment:
I have fixed the issue with line length, and taken Brian's advice re valname.
Updated patch for doctest and test.test_doctest2 is attached.
--
Added file: http://bugs.python.org/file16599/doctest_patch
Steven Bethard added the comment:
Someone pointed this out to me earlier:
http://pypi.python.org/pypi/genzshcomp
I believe it's trying to solve the same problem, and claims to work with both
optparse and argparse, so it might be worth looking into what it's doing and
seeing if
Steven Bethard added the comment:
Sorry, what does "I'll sit down to" mean? Does that mean you're offering to try
to do the argparse patch too? Or that you'd rather someone else do it? (Either
one's fine - I just
Steven Bethard added the comment:
Thanks for the patch! One concern I have is that adding --help-options by
default has the potential to break existing code, e.g. if someone using
optparse or argparse was already defining their own --help-options flag. The
backward compatible solution is to
Steven Bethard added the comment:
On Wed, Apr 21, 2010 at 12:36 AM, Andy Buckley wrote:
> Or to add the option just before arg parsing, if it has not already been
> defined?
Something like this was suggested before and it doesn't really work
out well. It means the first ti
Steven Bethard added the comment:
2010/4/21 Filip Gruszczyński :
> I don't really understand, why can't we just check if
> help-options is provided by the user and add our own,
> if it is not?
I'm sure it would be possible to do it this way. The question is
whether it
Steven Bethard added the comment:
On Wed, Apr 21, 2010 at 12:45 PM, Éric Araujo wrote:
> An obscure name reusing terms like “compword” that can be found easily in
> Python docs and Bash completion docs would be best.
Seems sensible. Does anyone know if zsh uses the same or a dif
Steven Bethard added the comment:
2010/5/9 Filip Gruszczyński :
> So, is there any decision here, so that I could get down to providing better
> patch?
I guess I'd like to hear from someone about how these things work in
zsh. If we're going to add a hidden flag to *all* pa
Steven Downum added the comment:
I have made a patch of the proposed fixed and ran the httplib test
afterwards, to make sure it passed.
--
nosy: +sdownum
Added file: http://bugs.python.org/file9237/1626_patch.diff
__
Tracker <[EMAIL PROTECTED]>
Steven Bethard <[EMAIL PROTECTED]> added the comment:
I'll take care of this, adding a bit to section 3.6.1, String Methods.
--
nosy: +bethard
__
Tracker <[EMAIL PROTECTED]>
<http://bugs.
Steven Bethard <[EMAIL PROTECTED]> added the comment:
I've got a patch against 2.6, and the docs seem to build fine. Since
I've never committed a doc patch before, I'd appreciate it if someone
could glance at this and make sure there's nothing obviously wrong.
---
Steven Bethard <[EMAIL PROTECTED]> added the comment:
Committed in revision 61453.
--
status: open -> closed
__
Tracker <[EMAIL PROTECTED]>
<http://bugs.py
Steven Bethard <[EMAIL PROTECTED]> added the comment:
I'll start looking at this.
--
nosy: +bethard
__
Tracker <[EMAIL PROTECTED]>
<http://bugs.
New submission from Steven Bethard <[EMAIL PROTECTED]>:
Some comparisons were changed or removed in Python 3.0. In 2.6 you could
compare types (e.g. ``str < int``) and dicts supported more than just
equality. These comparisons should produce Py3K warnings.
--
assignee
Steven Bethard <[EMAIL PROTECTED]> added the comment:
The code is only invoked when NotImplemented is produced. Take a look at
the attached patch to try_3way_to_rich_compare and see if you think it's
going to be too expensive.
--
keywords: +patch
Added file: http://bugs
Steven Bethard <[EMAIL PROTECTED]> added the comment:
I'm attaching a patch that handles object comparisons, type comparisons,
cell comparisons, and dict comparisons. All the tests pass (including
the new ones I've added) but I'd appreciate it if someone could take a
secon
Steven Bethard <[EMAIL PROTECTED]> added the comment:
Resolved in revision 61529.
--
status: open -> closed
__
Tracker <[EMAIL PROTECTED]>
<http://bugs.py
Steven Bethard <[EMAIL PROTECTED]> added the comment:
Revision 61529 adds warnings for object, type, cell and dict
comparisons. The code, method and slice warnings are still needed.
__
Tracker <[EMAIL PROTECTED]>
<http://bugs.pytho
Steven Bethard <[EMAIL PROTECTED]> added the comment:
On Tue, Mar 18, 2008 at 11:57 AM, Benjamin Peterson
<[EMAIL PROTECTED]> wrote:
> Benjamin Peterson <[EMAIL PROTECTED]> added the comment:
>
> Your patch kicks up warnings in Objects/cellobject.c because
> cel
Steven Bethard <[EMAIL PROTECTED]> added the comment:
So I believe it should be returning -2 instead of NULL. Can someone
verify that -2 means raise an exception for tp_compare?
__
Tracker <[EMAIL PROTECTED]>
<http://bugs.pytho
Steven Bethard <[EMAIL PROTECTED]> added the comment:
Ok, that warning should be gone now in trunk.
__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2373>
__
_
Steven Bethard <[EMAIL PROTECTED]> added the comment:
Fair enough. I agree that the deprecated APIs should still be tested.
But there are a lot of other warnings, e.g. where the standard lib uses
``has_key`` instead of ``in``. These should be removed. The only
warnings should be those th
Steven Bethard <[EMAIL PROTECTED]> added the comment:
I took a closer look at sliceobject.c and it looks like both 2.6 and 3.0
compare them basically as tuples. So there don't need to be any warnings
about using < and > since these are still well defined.
I'll have a patc
Steven Bethard <[EMAIL PROTECTED]> added the comment:
Resolved in revision 61570. I can't get svnmerge block to work though.
Since the code and method changes are just backports of Python 3,
someone needs to run ``svnmerge.py block -r 61570``.
__
Trac
Steven Bethard <[EMAIL PROTECTED]> added the comment:
Why can't you just iterate over ``vars(opts)``?
--
nosy: +bethard
__
Tracker <[EMAIL PROTECTED]>
<http://bugs.
Steven Bethard <[EMAIL PROTECTED]> added the comment:
But ``vars()`` is the standard Python mechanism for doing this sort of
thing (that is, treating an object like a dictionary). So, while I
understand that you find "iterating over opts to be nicer", calling it
more Python
Steven Bethard <[EMAIL PROTECTED]> added the comment:
My experience in the past has been that the optik/optparse maintainer
doesn't often respond to tickets in this tracker, though perhaps that
has changed recently.
__
Tracker <[EMAIL PRO
Steven Bethard <[EMAIL PROTECTED]> added the comment:
Subclassing dict seems like a bad idea. The options value returned by
.parse_args() is not supposed to be dict-like, it's supposed to be
object-like. That is, the natural way of accessing values from it is
through dotted attribute
New submission from Steven D'Aprano <[EMAIL PROTECTED]>:
import timing
help(timing)
=> MODULE DOCS
http://www.python.org/doc/current/lib/module-timing.html
but there doesn't appear to be any such page: the URL gives Error 404:
File Not Found. Searching the reference
New submission from Steven D'Aprano <[EMAIL PROTECTED]>:
The documentation for __import__ says that it primarily exists "so that
you can replace it with another function that has a compatible
interface, in order to change the semantics of the import statement".
http://do
New submission from Steven D'Aprano :
The inspect isSOMETHING() functions all return True or False, except
for isgeneratorfunction(), which returns True or None.
The body of the function is very brief:
if (isfunction(object) or ismethod(object)) and \
object.func_code.co_
New submission from Steven D'Aprano :
In the PEP for Decimal, it was discussed that the class should have a
from_float() method for converting from floats, but to leave it out of
the Python 2.4 version:
http://www.python.org/dev/peps/pep-0327/#from-float
Following discussions with
Steven D'Aprano added the comment:
Mark suggested the following strategy for Decimal.from_float: "always
use the largest exponent possible".
Just for the avoidance of all doubt, do you mean the largest exponent
with the number normalised to one digit to the right of the
Steven D'Aprano added the comment:
Raymond:
> Accordingly, I recommend Decimal.from_float(f) with no
> qualifiers or optional arguments.
-0 on this one. It's going to confuse an awful lot of newbies when
they write Decimal.from_float(1.1) and get
Decimal('1100
Steven D'Aprano added the comment:
Mark wrote:
>> Also, why not just extend the Decimal() constructor to accept
>> a float as the argument? Why have a separate from_float()
>> method at all?
>
> This was discussed extensively when the decimal module was
> bein
Steven Bethard added the comment:
The whole point was to have a function (or class) that accumulates a
sequence and counts it. collections.defaultdict(lambda: 0) doesn't
achieve this on its own because it only knows how to handle sequences of
(key, value):
>>> d = collectio
New submission from Steven D'Aprano :
Documentation for files states that when writing to a file, unicode
strings are converted to byte strings using the encoding specified by
file.encoding.
http://docs.python.org/library/stdtypes.html#file.encoding
sys.stdout is a file, but it doe
Changes by Steven D'Aprano :
--
nosy: +stevenjd
___
Python tracker
<http://bugs.python.org/issue2527>
___
___
Python-bugs-list mailing list
Unsubsc
New submission from Steven D'Aprano :
When launching IDLE, it reports:
"IDLE's subprocess didn't make connection. Either IDLE can't start a
subprocess or personal firewall software is blocking the connection."
This should report what needs to be opened on the fir
New submission from Steven D'Aprano :
Documentation for IDLE states:
Starting IDLE on UNIX
On Unix, just type "idle" at a command prompt. This should bring
up a Window similar to the one above. (If it doesn't, look for
the "idle" script in the Tool
New submission from Steven D'Aprano :
Using the wrong sort of quotes in json gives unhelpful error messages:
>>> json.loads("{'test':'test'}")
Traceback (most recent call last):
...
ValueError: Expecting property name: line 1 column 1 (char 1)
Changes by Steven D'Aprano :
--
components: +Library (Lib)
type: -> behavior
___
Python tracker
<http://bugs.python.org/issue5067>
___
___
Python-bugs-lis
New submission from Steven Bethard :
The bdist_msi command is documented in the distutils reference:
http://docs.python.org/distutils/apiref.html#module-distutils.command.bdist_msi
But it does not show up with "bdist --help-formats"
$ python setup.py bdist --help-formats
List of
Steven D'Aprano added the comment:
For what it's worth, this bug appears to go back to at least Python 2.4,
and it affects functions using decorators even if they are defined in
the same module as the decorated function. I've applied the patch to my
2.4 installation, and it
Steven D'Aprano added the comment:
Earlier I wrote:
"I've applied the patch to my 2.4 installation, and it doesn't fix the
issue. I'd like to request this be reopened, because I don't believe the
patch works as advertised."
Nevermind, I withdraw the request.
Steven Silvester added the comment:
The use case that prompted https://github.com/python/cpython/pull/31679 is that
we are adding typings to `PyMongo`. We are late to using typings, because we
only recently dropped Python 2.7 support.
We have an existing options class that subclasses
Steven D'Aprano added the comment:
The behaviour is technically correct, but confusing and unfortunate, and I
don't think we can fix it.
Unicode does not define names for the ASCII control characters. But it does
define aliases for them, based on the C0 control cha
Steven Silvester added the comment:
I agree we're stuck with the typing stub workaround for our use case. We can
re-submit a "fix forward" PR.
--
___
Python tracker
<https://bugs.pyt
New submission from Steven D'Aprano :
I'm reluctant to call this a bug, as small int interning/caching is an
implementation detail and there are no hard guarantees made.
But on the other hand, it seems that the intention is that small ints such as
0, 1 and 2 should be cached. Her
Change by Steven D'Aprano :
--
nosy: +steven.daprano
___
Python tracker
<https://bugs.python.org/issue46967>
___
___
Python-bugs-list mailing list
Unsubscr
Steven D'Aprano added the comment:
What makes you think you are supposed to be able to import _simple_enum? It is
a name with a leading underscore, so even if it exists, it is private and you
shouldn't touch it.
Unless _simple_enum is documented as something you can use, this is
New submission from Steven D'Aprano :
The IEEE-754 requirement that NANs are never equal to anything, even to
themselves, is a common stumbling block for those new to the consequences of
IEEE-754. See for example #47020.
The documentation for math.nan would be a good place to add a note
Steven D'Aprano added the comment:
Here is another example of a newbie caught by this:
https://discuss.python.org/t/syntax-error-in-python-3-10-when-running-on-terminal/14462
--
___
Python tracker
<https://bugs.python.org/is
Steven D'Aprano added the comment:
> We cannot guarantee that NAN never equal to anything, because we can
> create an object equal to it. For example mock.ANY
Sure. I don't expect that mock.ANY or other weird objects should obey
the IEEE-754 rules. But we're talking num
New submission from Steven D'Aprano :
OverflowError sometimes (but not always) includes some sort of numeric code:
>>> 1e+300 ** 2
Traceback (most recent call last):
File "", line 1, in
OverflowError: (34, 'Numerical result out of range')
but the meaning o
Steven D'Aprano added the comment:
I don't think this change of behaviour should be accepted without discussion,
and I'm not sure why you think Python-Dev is the right place, rather than here.
Messing around with unittest and docstrings has already caused issues in th
Steven D'Aprano added the comment:
I have no problem with pinging Python-Dev, or any other forum, asking
for interested parties. I just don't think we should be intentionally
spliting the discussion more than it's going to get split organically.
(If this is interesting to pe
New submission from Steven D'Aprano :
Whenever I use decimal and need to change the context temporarily, without fail
I try to write
with decimal.localcontext(prec=10):
...
or similar. Then I get surprised that it fails, and re-write it as
with decimal.localcontext() a
Steven D'Aprano added the comment:
> the programmer may use the variable __name__ for some other purposes
Dunder names like `__name__` are reserved for the use of the interpreter. If
the programmer uses them for "other purposes", the programmer is responsible
for any failu
Steven D'Aprano added the comment:
Rather than an option for this, it would be cleaner to deprecate the
current output in 3.11, and fix it in 3.12 or 3.13.
Otherwise we have to maintain the old (bad?) output and the new output
both fo
Steven D'Aprano added the comment:
See this thread on Discuss:
https://discuss.python.org/t/logging-timedrotatingfilehandler-never-rotates-in-certain-cases/14747/1
--
nosy: +steven.daprano
___
Python tracker
<https://bugs.python.org/is
Steven D'Aprano added the comment:
I'm not sure what the implementation uses to enforce this, but decimal
contexts already seem to reject arbitrary attributes. So a naive
implementation that just setattr()'s the keyword arguments will
automatically fail:
>>> from d
Steven D'Aprano added the comment:
Perhaps what you want is inspect.isroutine ?
https://docs.python.org/3/library/inspect.html#inspect.isroutine
I agree with Dennis that the isfunction test is for **Python** (def or lambda)
functions, not builtins. The docstring for the inspect.is* me
Steven D'Aprano added the comment:
I came here from #47221.
If I am reading this correctly, it concerns me that stack operations (which
should be fast) are apparently slow?
If we can't reduce the number of stack operations, can we speed them up?
--
nosy: +steven.dapr
Steven D'Aprano added the comment:
Isn't this just a quality of implementation issue?
math.isfinite should return True for all ints, since all ints are finite.
(There are no int infinities or NANs). There is no need to coerce them to float
to know that they are finite.
Li
Change by Steven D'Aprano :
--
nosy: +steven.daprano
___
Python tracker
<https://bugs.python.org/issue47234>
___
___
Python-bugs-list mailing list
Unsubscr
Steven D'Aprano added the comment:
It would be nice if the class creation process was documented a bit
better. Here is my experiment to see what is going on:
```
# the global `__name__` is normally the module's name.
__name__ = "something"
class Meta_default_prepare(ty
Change by Steven D'Aprano :
--
nosy: +steven.daprano
___
Python tracker
<https://bugs.python.org/issue47259>
___
___
Python-bugs-list mailing list
Unsubscr
Steven D'Aprano added the comment:
On Wed, Aug 21, 2019 at 10:51:02AM +, STINNER Victor wrote:
> Rather than adding a new function, why not adding a parameter like
> sort(key=func, reverse=True)? Something like fnmatch.filterfalse(pat,
> invert=True)?
Guido argues tha
Steven D'Aprano added the comment:
On Sat, Aug 24, 2019 at 10:09:40AM +, Serhiy Storchaka wrote:
> Could you please explain what is wrong in adding a helper function
> which will help to convert different types of numbers to integer ratio
> correctly?
>
> Currently
Steven D'Aprano added the comment:
If they are provided by the C lib, I would love to see them exposed by Python.
If they aren't, I don't know if they should be treated as optional/platform
dependent, or if we should provide an independent implementation. I guess the
easy
Steven D'Aprano added the comment:
It may help if you read this:
http://sscce.org/
It is written for Java programmers but it applies to Python as well.
Don't expect us to re-type your code from a hard-to-read, out-of-focus,
low-resolution photo of your monitor. Copy and paste the
Steven D'Aprano added the comment:
Further to Karthikeyan Singaravelan comment, the behaviour you see is
absolutely correct. The operator isn't behaving differently, it is reporting
precisely the truth.
The ``is`` operator tests for object identity, not equality. Python makes no
Steven D'Aprano added the comment:
Hi Gaurav,
It is very unlikely that you have "discovered a bug in Python". Millions of
people use Python every day, and the chances that you will have noticed
something that everyone else has missed is tiny.
More likely you have misunder
Steven D'Aprano added the comment:
Before proposing a third party module for inclusion in the standard library,
you should check:
- is the module mature and stable?
- does it have an FOSS licence compatible with Python, and if not, are the
authors willing to re-licence it?
- ar
Steven D'Aprano added the comment:
Tim is correct, the behaviour is right, however the docs could be clearer.
I think what you are missing is that ``or`` and ``and`` are short-circuiting
operators. So in the expression
9 or (anything)
the "anything" expression never
Steven D'Aprano added the comment:
I think that the problem is that the precedence table may be technically
correct, but it doesn't describe the actual behaviour of expressions
including the boolean operators ``or`` and ``and`` for exactly the
reason Tim gives:
> Precedence ru
Steven D'Aprano added the comment:
"The implementation adds a few special read-only attributes to several object
TYPES" [emphasis added]
py> class MyType:
... pass
...
py> MyType.__dict__ = {}
Traceback (most recent call last):
File "", line 1, in
Attr
Steven D'Aprano added the comment:
Oh, another point...
Python is a little more complicated than some other languages, like Java,
because Python classes (types) are themselves instances (objects) of yet
another class (the so called "metaclass"). Ultimately, all classes ar
Steven D'Aprano added the comment:
Here's a possibly simpler version which nevertheless still shows multiple calls
to __eq__ (in this case, only 6, not 13):
class C(object):
def __eq__(self, other):
print('eq')
return super().__eq__(other)
Change by Steven D'Aprano :
--
nosy: +steven.daprano
___
Python tracker
<https://bugs.python.org/issue37168>
___
___
Python-bugs-list mailing list
Unsubscr
Change by Steven D'Aprano :
--
nosy: +steven.daprano
___
Python tracker
<https://bugs.python.org/issue38171>
___
___
Python-bugs-list mailing list
Unsubscr
Steven D'Aprano added the comment:
This is not a bug. ``sys.maxsize`` is just an int instance, and it has no
docstring itself. When you look up ``sys.maxsize.__doc__``, or call
``help(sys.maxsize)``, the ordinary inheritance rules apply and you get the
class docstring.
There is no
Steven D'Aprano added the comment:
Are your tests so huge that you need to gzip them before uploading? That makes
them extremely difficult to read from the browser, and makes me extremely
suspicious that this could be some form of zip bomb or other malware. Couldn't
you upload a
Steven D'Aprano added the comment:
I took the health of my PC into my hands *smiles* and unzipped your test cases.
I don't know .sh scripts well, so I didn't run that (and Windows users won't be
able to run it), but I looked at the Python scripts, and I think I have
Steven D'Aprano added the comment:
I'm not an expert on super and multiple inheritance, but let me see if I can
explain what is going on. (Hopefully an expert will correct me if I get
something wrong.)
1. The class C(A_With_Arg, B_With_Arg) is straight-forward: the super call
Steven D'Aprano added the comment:
Apologies for the Python 2.7 incompatible syntax, I hadn't noticed that you had
selected 2.7. But since 2.7 (and 3.8) are in feature freeze, any behavoural
changes can only apply to 3.9 or later.
I'm afraid that you haven't explained wh
Steven D'Aprano added the comment:
On Tue, Sep 24, 2019 at 08:54:49PM +, Arno-Can Uestuensoez wrote:
> Or reduced to the focus of the actual issue and depicted the actual
> passed parameters. See the following "Case 4 - same as
> mixin_C_is_B0A1" for the essen
Steven D'Aprano added the comment:
What `readmodule` are you referring to?
3.6 is in feature-freeze. The earliest that any enhancement could be added is
version 3.9.
Can you explain how having an ending line number as well as the starting line
number can be used to check which import
Steven D'Aprano added the comment:
Sounds like a great idea to me.
Thanks,
Steven
--
___
Python tracker
<https://bugs.python.org/issue38308>
___
___
Pytho
Steven D'Aprano added the comment:
This is nothing to do with platform.system. You can see the same behaviour with
any string comparison, or ints.
The `is` operator is not a cute way of spelling `==`, it tests for object
identity, not equality. It tests whether the two arguments ar
Steven D'Aprano added the comment:
Please don't create a *second* bug report to say that your previous bug report
was erroneous. Just go and close the first one.
--
nosy: +steven.daprano
resolution: -> not a bug
stage: -> resolved
status
Steven D'Aprano added the comment:
False alarm, see Stephen Tucker's message here
https://bugs.python.org/issue38365#msg353854
File name has a trailing space which is why it wasn't found.
--
nosy: +steven.daprano
resolution: -> works for me
stage: ->
Steven D'Aprano added the comment:
I agree with Ned closing this issue, but just glancing at the logs, it looks to
me like buildozer has shadowed your Python's ctypes with a broken ctypes in
/home/yzw/Desktop/Test/.buildozer/android/platform/build/build/other_builds/hostpytho
Steven D'Aprano added the comment:
Thanks Warren, the resistance example is excellent, would you like to write up
a PR to add it to the docs?
In the original design, I prohibited negative numbers because that seems to be
what everyone says you should do, but as far as I can tell
Steven D'Aprano added the comment:
Importing the second and subsequent times reloads the module from the system
cache. Instead, you can:
- run ``del sys.modules['hexdump']`` and then ``import hexdump``;
- call ``importlib.reload(hexdump)``; or
- restart the REPL.
Remember
Steven D'Aprano added the comment:
All versions below 3.9 are in feature freeze, so they cannot get new features.
This requested feature is already supported by subclassing ``dict`` and giving
it a ``__missing__`` method. See issue #38315
--
nosy: +steven.daprano
resol
Steven D'Aprano added the comment:
This is not a bug, this is the design of function default arguments.
Default arguments in Python use *early binding*, which means they are
calculated once, when the function is declared, rather than *late binding*,
which means they are calculated each
Steven D'Aprano added the comment:
Oh, I forgot to mention that this is discussed in one of the FAQs:
https://docs.python.org/3/faq/programming.html#why-are-default-values-shared-between-objects
--
___
Python tracker
<https://bugs.py
201 - 300 of 1942 matches
Mail list logo