[issue8128] String interpolation with unicode subclass fails to call __str__

2010-03-20 Thread Steven D'Aprano
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

[issue4037] doctest.py should include method descriptors when looking inside a class __dict__

2010-03-20 Thread Steven D'Aprano
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

[issue4256] optparse: provide a simple way to get a programmatically useful list of options

2010-04-03 Thread Steven Bethard
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

[issue4256] optparse: provide a simple way to get a programmatically useful list of options

2010-04-19 Thread Steven Bethard
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

[issue4256] optparse: provide a simple way to get a programmatically useful list of options

2010-04-20 Thread Steven Bethard
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

[issue4256] optparse: provide a simple way to get a programmatically useful list of options

2010-04-21 Thread Steven Bethard
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

[issue4256] optparse/argparse: provide a simple way to get a programmatically useful list of options

2010-04-21 Thread Steven Bethard
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

[issue4256] optparse/argparse: provide a simple way to get a programmatically useful list of options

2010-04-21 Thread Steven Bethard
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

[issue4256] optparse/argparse: provide a simple way to get a programmatically useful list of options

2010-05-09 Thread Steven Bethard
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

[issue1627] Problem with httplib and Content-Length: -1

2008-01-19 Thread Steven Downum
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]>

[issue2326] Doc isnumeric and isdecimal for the unicode object

2008-03-17 Thread Steven Bethard
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.

[issue2326] Doc isnumeric and isdecimal for the unicode object

2008-03-17 Thread Steven Bethard
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. ---

[issue2326] Doc isnumeric and isdecimal for the unicode object

2008-03-17 Thread Steven Bethard
Steven Bethard <[EMAIL PROTECTED]> added the comment: Committed in revision 61453. -- status: open -> closed __ Tracker <[EMAIL PROTECTED]> <http://bugs.py

[issue2342] Comparing between disparate types should raise a Py3K warning

2008-03-17 Thread Steven Bethard
Steven Bethard <[EMAIL PROTECTED]> added the comment: I'll start looking at this. -- nosy: +bethard __ Tracker <[EMAIL PROTECTED]> <http://bugs.

[issue2373] Raise Py3K warnings for comparisons that changed

2008-03-17 Thread Steven Bethard
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

[issue2342] Comparing between disparate types should raise a Py3K warning

2008-03-17 Thread Steven Bethard
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

[issue2373] Raise Py3K warnings for comparisons that changed

2008-03-17 Thread Steven Bethard
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

[issue2342] Comparing between disparate types should raise a Py3K warning

2008-03-18 Thread Steven Bethard
Steven Bethard <[EMAIL PROTECTED]> added the comment: Resolved in revision 61529. -- status: open -> closed __ Tracker <[EMAIL PROTECTED]> <http://bugs.py

[issue2373] Raise Py3K warnings for comparisons that changed

2008-03-18 Thread Steven Bethard
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

[issue2373] Raise Py3K warnings for comparisons that changed

2008-03-18 Thread Steven Bethard
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

[issue2373] Raise Py3K warnings for comparisons that changed

2008-03-18 Thread Steven Bethard
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

[issue2373] Raise Py3K warnings for comparisons that changed

2008-03-18 Thread Steven Bethard
Steven Bethard <[EMAIL PROTECTED]> added the comment: Ok, that warning should be gone now in trunk. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2373> __ _

[issue2402] get rid of warnings in regrtest with -3

2008-03-18 Thread Steven Bethard
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

[issue2373] Raise Py3K warnings for comparisons that changed

2008-03-18 Thread Steven Bethard
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

[issue2373] Raise Py3K warnings for comparisons that changed

2008-03-18 Thread Steven Bethard
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

[issue2444] Adding __iter__ to class Values of module optparse

2008-03-23 Thread Steven Bethard
Steven Bethard <[EMAIL PROTECTED]> added the comment: Why can't you just iterate over ``vars(opts)``? -- nosy: +bethard __ Tracker <[EMAIL PROTECTED]> <http://bugs.

[issue2444] Adding __iter__ to class Values of module optparse

2008-03-23 Thread Steven Bethard
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

[issue2444] Adding __iter__ to class Values of module optparse

2008-03-23 Thread Steven Bethard
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

[issue2444] Adding __iter__ to class Values of module optparse

2008-04-02 Thread Steven Bethard
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

[issue4255] timing module refers to non-existent documentation

2008-11-03 Thread Steven D'Aprano
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

[issue4457] __import__ documentation obsolete

2008-11-28 Thread Steven D'Aprano
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

[issue4795] inspect.isgeneratorfunction inconsistent with other inspect functions

2008-12-31 Thread Steven D'Aprano
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_

[issue4796] Decimal to receive from_float method

2008-12-31 Thread Steven D'Aprano
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

[issue4796] Decimal to receive from_float method

2009-01-02 Thread Steven D'Aprano
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

[issue4796] Decimal to receive from_float method

2009-01-02 Thread Steven D'Aprano
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

[issue4796] Decimal to receive from_float method

2009-01-02 Thread Steven D'Aprano
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

[issue1696199] Add collections.counts()

2009-01-12 Thread Steven Bethard
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

[issue4947] sys.stdout fails to use default encoding as advertised

2009-01-14 Thread Steven D'Aprano
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

[issue2527] Pass a namespace to timeit

2009-01-23 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- nosy: +stevenjd ___ Python tracker <http://bugs.python.org/issue2527> ___ ___ Python-bugs-list mailing list Unsubsc

[issue5065] IDLE improve Subprocess Startup Error message

2009-01-25 Thread Steven D'Aprano
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

[issue5066] IDLE documentation for Unix obsolete/incorrect

2009-01-25 Thread Steven D'Aprano
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

[issue5067] Error msg from using wrong quotes in JSON is unhelpful

2009-01-25 Thread Steven D'Aprano
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)

[issue5067] Error msg from using wrong quotes in JSON is unhelpful

2009-01-26 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- components: +Library (Lib) type: -> behavior ___ Python tracker <http://bugs.python.org/issue5067> ___ ___ Python-bugs-lis

[issue5095] msi missing from "bdist --help-formats"

2009-01-28 Thread Steven Bethard
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

[issue1108] Problem with doctest and decorated functions

2009-02-13 Thread Steven D'Aprano
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

[issue1108] Problem with doctest and decorated functions

2009-02-14 Thread Steven D'Aprano
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.

[issue43923] Can't create generic NamedTuple as of py3.9

2022-03-07 Thread Steven Silvester
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

[issue46947] unicodedata.name gives ValueError for control characters

2022-03-07 Thread Steven D'Aprano
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

[issue43923] Can't create generic NamedTuple as of py3.9

2022-03-08 Thread Steven Silvester
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

[issue46961] Caching/interning of small ints sometimes fails

2022-03-08 Thread Steven D'Aprano
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

[issue46967] Type union for except

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

[issue47018] ImportError: cannot import name '_simple_enum' from 'enum'

2022-03-14 Thread Steven D'Aprano
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

[issue47031] math.nan should note that NANs do not compare equal to anything

2022-03-15 Thread Steven D'Aprano
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

[issue45297] Improve the IDLE shell save command

2022-03-20 Thread Steven D'Aprano
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

[issue47031] math.nan should note that NANs do not compare equal to anything

2022-03-24 Thread Steven D'Aprano
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

[issue47134] Document the meaning of the number in OverflowError

2022-03-26 Thread Steven D'Aprano
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

[issue47133] enhance unittest to show test name and docstring on one line

2022-03-26 Thread Steven D'Aprano
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

[issue47133] enhance unittest to show test name and docstring on one line

2022-03-26 Thread Steven D'Aprano
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

[issue47135] Allow decimal.localcontext to accept keyword arguments to set context attributes

2022-03-27 Thread Steven D'Aprano
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

[issue47136] Wrong value assigned automatically to the variable __module__ in the class body.

2022-03-27 Thread Steven D'Aprano
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

[issue47133] enhance unittest to show test name and docstring on one line

2022-03-27 Thread Steven D'Aprano
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

[issue40469] TimedRotatingFileHandler rotating on use not time

2022-03-31 Thread Steven D'Aprano
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

[issue47135] Allow decimal.localcontext to accept keyword arguments to set context attributes

2022-04-01 Thread Steven D'Aprano
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

[issue47214] builtin_function_or_method is also either a function or a method

2022-04-04 Thread Steven D'Aprano
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

[issue45542] Using multiple comparison operators can cause performance issues

2022-04-04 Thread Steven D'Aprano
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

[issue47121] math.isfinite() can raise exception when called on a number

2022-04-05 Thread Steven D'Aprano
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

[issue47234] PEP-484 "numeric tower" approach makes it hard/impossible to specify contracts in documentation

2022-04-06 Thread Steven D'Aprano
Change by Steven D'Aprano : -- nosy: +steven.daprano ___ Python tracker <https://bugs.python.org/issue47234> ___ ___ Python-bugs-list mailing list Unsubscr

[issue47136] The variable __module__ in the class body getting an undesirable value from __prepare__ of the metaclass

2022-04-07 Thread Steven D'Aprano
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

[issue47259] string sorting often incorrect

2022-04-08 Thread Steven D'Aprano
Change by Steven D'Aprano : -- nosy: +steven.daprano ___ Python tracker <https://bugs.python.org/issue47259> ___ ___ Python-bugs-list mailing list Unsubscr

[issue30413] Add fnmatch.filterfalse function

2019-08-21 Thread Steven D'Aprano
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

[issue37884] Optimize Fraction() and statistics.mean()

2019-08-25 Thread Steven D'Aprano
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

[issue37946] Add the Bessel functions of the first and second kind to the math module

2019-08-25 Thread Steven D'Aprano
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

[issue37988] Issue found during language name processing in a list

2019-08-30 Thread Steven D'Aprano
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

[issue38001] Unexpected behaviour of 'is' operator

2019-09-01 Thread Steven D'Aprano
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

[issue38048] unususal behavior

2019-09-07 Thread Steven D'Aprano
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

[issue38052] Include sspipe Module with Core Python

2019-09-07 Thread Steven D'Aprano
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

[issue38060] precedence (relational, logical operator)not working with single value

2019-09-09 Thread Steven D'Aprano
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

[issue38060] precedence (relational, logical operator)not working with single value

2019-09-10 Thread Steven D'Aprano
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

[issue38099] __dict__ attribute is incorrectly stated to be read-only

2019-09-11 Thread Steven D'Aprano
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

[issue38099] __dict__ attribute is incorrectly stated to be read-only

2019-09-11 Thread Steven D'Aprano
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

[issue38105] hash collision when hash(x) == -2 causes many calls to __eq__

2019-09-11 Thread Steven D'Aprano
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)

[issue37168] Decimal divisions sometimes 10x or 100x too large

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

[issue38171] super() is passing wrong parameters while handling diamond inheritance

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

[issue38213] sys.maxsize returns incorrect docstring.

2019-09-18 Thread Steven D'Aprano
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

[issue38262] Mixins - super calls in bases of multiple-inheritance with different parameters

2019-09-24 Thread Steven D'Aprano
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

[issue38262] Mixins - super calls in bases of multiple-inheritance with different parameters

2019-09-24 Thread Steven D'Aprano
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

[issue38262] Mixins - super calls in bases of multiple-inheritance with different parameters

2019-09-24 Thread Steven D'Aprano
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

[issue38262] Mixins - super calls in bases of multiple-inheritance with different parameters

2019-09-24 Thread Steven D'Aprano
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

[issue38262] Mixins - super calls in bases of multiple-inheritance with different parameters

2019-09-25 Thread Steven D'Aprano
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

[issue38307] Provide Class' end line in readmodule module

2019-09-28 Thread Steven D'Aprano
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

[issue38308] Add optional weighting to statistics.harmonic_mean()

2019-09-29 Thread Steven D'Aprano
Steven D'Aprano added the comment: Sounds like a great idea to me. Thanks, Steven -- ___ Python tracker <https://bugs.python.org/issue38308> ___ ___ Pytho

[issue38362] platform.system() comparison problem

2019-10-03 Thread Steven D'Aprano
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

[issue38365] Issue 38363 - False Alarm - Sorry!

2019-10-03 Thread Steven D'Aprano
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

[issue38363] No Module named ..." and UTF-8 Byte Order Marks

2019-10-03 Thread Steven D'Aprano
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: ->

[issue38386] ModuleNotFoundError: No module named '_ctypes'

2019-10-06 Thread Steven D'Aprano
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

[issue38382] statistics.harmonic_mean fails to raise error with negative input that follows a 0

2019-10-06 Thread Steven D'Aprano
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

[issue38399] Error message persists when reimporting library

2019-10-07 Thread Steven D'Aprano
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

[issue38420] defaultdict does not support parametric lambda

2019-10-09 Thread Steven D'Aprano
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

[issue38451] Datetime definition does not work in function definition as list definition

2019-10-12 Thread Steven D'Aprano
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

[issue38451] Datetime definition does not work in function definition as list definition

2019-10-12 Thread Steven D'Aprano
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

<    1   2   3   4   5   6   7   8   9   10   >