[issue37934] Docs: Clarify NotImplemented use cases

2019-09-01 Thread Kyle Stanley
Kyle Stanley added the comment: > Would it be viable to rephrase the existing section in a manner that explains > the functional purpose of NotImplemented without revolving around its use > case in binary special methods? To expand further upon this, here's an initial idea for improving the

[issue37934] Docs: Clarify NotImplemented use cases

2019-09-01 Thread Kyle Stanley
Kyle Stanley added the comment: Thanks for the feedback Vedran and Raymond. > It is not the purpose of the docs to list use cases. Mostly we say what > something does or how it is defined. As Vedran says, how people use it is > their own business. The underlying issue here seems to be

[issue37995] Multiline ast.dump()

2019-09-01 Thread Raymond Hettinger
Change by Raymond Hettinger : Added file: https://bugs.python.org/file48580/ast_bloop.py ___ Python tracker ___ ___ Python-bugs-list

[issue37995] Multiline ast.dump()

2019-09-01 Thread Raymond Hettinger
Change by Raymond Hettinger : Removed file: https://bugs.python.org/file48579/ast_bloop.py ___ Python tracker ___ ___ Python-bugs-list

[issue24416] Have date.isocalendar() return a structseq instance

2019-09-01 Thread Paul Ganssle
Paul Ganssle added the comment: > Dong-hee Na, if you want to make a fresh PR for this and bring it to > fruition, I would be happy to review and apply it. It seems premature to say that you will accept a PR for this when there's no consensus for actually adding the feature, and it would be

[issue38003] Incorrect "fixing" of isinstance tests for basestring

2019-09-01 Thread Bob Kline
Bob Kline added the comment: > Use str instead. Sure. I understand the advantages of the new approach to strings. Which, by the way, weren't available when this project began. I don't disagree with anything you say in the context of writing new code. I was, however, surprised and dismayed

[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 promises

[issue38003] Incorrect "fixing" of isinstance tests for basestring

2019-09-01 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: https://docs.python.org/3.0/whatsnew/3.0.html > The builtin basestring abstract type was removed. Use str instead. The str > and bytes types don’t have functionality enough in common to warrant a shared > base class. The 2to3 tool (see below)

[issue38003] Incorrect "fixing" of isinstance tests for basestring

2019-09-01 Thread Bob Kline
New submission from Bob Kline : We are attempting to convert a large Python 2 code base. Following the guidance of the official documentation (https://docs.python.org/2/library/functions.html#basestring) we created tests in many, many places that look like this: if isinstance(value,

[issue37995] Multiline ast.dump()

2019-09-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: It would be great is the tool wasn't tightly bound to our particular AST and could be used for any hand-rolled AST. -- ___ Python tracker

[issue37995] Multiline ast.dump()

2019-09-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, I wrote a generic AST pretty printer for a personal compiler project (see attached file). Perhaps it can be adapted to the Python AST. ## Example input ### Program(procs=[Procedure(name='FACTORIAL', params=['N'],

[issue24416] Have date.isocalendar() return a structseq instance

2019-09-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: Why close this? Having isocalendar() return a structseq instance would be a nice improvement. It is what structseq was designed for. Dong-hee Na, if you want to make a fresh PR for this and bring it to fruition, I would be happy to review and apply it.

[issue38002] 'ModifiedInterpreter' object has no attribute 'interp'

2019-09-01 Thread Raymond Hettinger
New submission from Raymond Hettinger : Here's a new traceback I haven't seen before. I only see these at the end of a session, so I don't know which steps triggered it. $ python3.8 -m idlelib.idle tmp_pretty_fact_ast.py Exception in Tkinter callback Traceback (most recent call last): File

[issue24416] Return a namedtuple from date.isocalendar()

2019-09-01 Thread Dong-hee Na
Dong-hee Na added the comment: @taleinat @p-ganssle I am okay with closing this issue without any change. My initial purpose for this issue was also whether or not to close a long left issue. I am +1 to closing this issue without any change. Please leave a vote for this issue. If @taleinat

[issue24416] Return a namedtuple from date.isocalendar()

2019-09-01 Thread Tal Einat
Tal Einat added the comment: Paul, I'm also on the fence regarding the advantage of this. It's not clear that the minor possible benefits outweigh the additional complexity and slight backwards-incompatibility (pickling). Thinking about this further, yes, we'd probably avoid making this

[issue24416] Return a namedtuple from date.isocalendar()

2019-09-01 Thread Dong-hee Na
Dong-hee Na added the comment: @pganssle @serhiy.storchaka Sounds reasonable on the view of maintaining pure Python and C APIs at the time Thank you for the explanation. -- ___ Python tracker

[issue24416] Return a namedtuple from date.isocalendar()

2019-09-01 Thread Paul Ganssle
Paul Ganssle added the comment: > But I'm wondering how the `fromisocalendar` API relates to this patch. > Rather, wouldn't this patch contribute to improving the usability of the > `fromisocalendar` API? The `fromisocalendar` API relates to this patch only insofar as it is the inverse

[issue24416] Return a namedtuple from date.isocalendar()

2019-09-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: You can use datetime.date.fromisocalendar(*b). -- ___ Python tracker ___ ___ Python-bugs-list

[issue24416] Return a namedtuple from date.isocalendar()

2019-09-01 Thread Dong-hee Na
Dong-hee Na added the comment: @p-ganssle @taleinat I agree that there are penalties of this patch what you said. But I'm wondering how the `fromisocalendar` API relates to this patch. Rather, wouldn't this patch contribute to improving the usability of the `fromisocalendar` API? I would

[issue38001] Unexpected behaviour of 'is' operator

2019-09-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue38001] Unexpected behaviour of 'is' operator

2019-09-01 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: This will emit a SyntaxWarning in Python 3.8 to use == instead of using is for literals. This is not a bug but an implementation detail over caching a range of integers at

[issue38001] Unexpected behaviour of 'is' operator

2019-09-01 Thread Digin Antony
New submission from Digin Antony : The 'is' operator behave differently on two sets of values please find the attachment below tested environment windows 7 python 3.7.3 Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright",

[issue24416] Return a namedtuple from date.isocalendar()

2019-09-01 Thread Paul Ganssle
Paul Ganssle added the comment: Sorry for the late response after a patch, but I'm actually -1 on this patch. I don't think it buys us very much in terms of the API considering it only has 3 parameters, and it adds some complexity to the code (in addition to the performance issue).

[issue36889] Merge StreamWriter and StreamReader into just asyncio.Stream

2019-09-01 Thread Thrlwiti
Change by Thrlwiti : -- nosy: -THRlWiTi ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36889] Merge StreamWriter and StreamReader into just asyncio.Stream

2019-09-01 Thread Thrlwiti
Change by Thrlwiti : -- nosy: +THRlWiTi ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38000] importlib can not handle module file names with periods

2019-09-01 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38000] importlib can not handle module file names with periods

2019-09-01 Thread Andrey
New submission from Andrey : ``` import os, sys def import_module(dir_path, module_name, ref_module_name = None): module_file_path = os.path.join(dir_path, module_name).replace('\\', '/') if sys.version_info[0] > 3 or sys.version_info[0] == 3 and sys.version_info[1] >= 4: import

[issue37998] re.sub(r'\\', r'\\\\', s) reporting MemoryError

2019-09-01 Thread Guruprasad Venkataramaiah
Guruprasad Venkataramaiah added the comment: With more debug, observed the input string ('s') is getting assigned to a big string of '' resulting in Memory error -- stage: -> resolved status: open -> closed ___ Python tracker

[issue37998] re.sub(r'\\', r'\\\\', s) reporting MemoryError

2019-09-01 Thread Guruprasad Venkataramaiah
Guruprasad Venkataramaiah added the comment: With more debug, observed the input string ('s') is getting assigned to a big string of '' resulting in Memory error -- resolution: -> not a bug ___ Python tracker

[issue37999] No longer use implicit convertion to int with loss

2019-09-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +15304 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15636 ___ Python tracker

[issue37999] No longer use implicit convertion to int with loss

2019-09-01 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Use only the __index__() method for implicit conversion to iteger, and not __int__(). This converts deprecation warnings added in issue36048 into TypeError. -- components: Interpreter Core messages: 350947 nosy: serhiy.storchaka priority: normal

[issue37993] os.path.realpath on Windows resolves mapped network drives

2019-09-01 Thread Eryk Sun
Eryk Sun added the comment: >> Unix Python resolves the executable path with repeated _Py_wreadlink >> calls. Windows Python should do something similar to ensure the >> consistency of sys.executable with realpath(sys.executable). > > I don't think this necessarily follows. There's nowhere

[issue37994] Fix silencing all errors if an attribute lookup fails

2019-09-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue37994] Fix silencing all errors if an attribute lookup fails

2019-09-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 353053d9ad08fea0e205e6c008b8a4350c0188e6 by Serhiy Storchaka in branch '3.8': [3.8] bpo-37994: Fix silencing all errors if an attribute lookup fails. (GH-15630) (GH-15635)

[issue37998] re.sub(r'\\', r'\\\\', s) reporting MemoryError

2019-09-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What is s? -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue37998] re.sub(r'\\', r'\\\\', s) reporting MemoryError

2019-09-01 Thread Guruprasad Venkataramaiah
New submission from Guruprasad Venkataramaiah : On Python 3.5: s = re.sub(r'\\', r'', s) File "/pyuniti/venvs/guruv/lib/python3.5/re.py", line 182, in sub return _compile(pattern, flags).sub(repl, string, count) MemoryError On Python 3.7 s = re.sub(r'\\', r'', s) File

[issue15999] Using new 'bool' format character

2019-09-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 1f21eaa15e8a0d2b0f78d0e3f2b9e5b458eb0a70 by Serhiy Storchaka in branch 'master': bpo-15999: Clean up of handling boolean arguments. (GH-15610) https://github.com/python/cpython/commit/1f21eaa15e8a0d2b0f78d0e3f2b9e5b458eb0a70 --

[issue15999] Using new 'bool' format character

2019-09-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 5eca7f3f3836cc734dfe8dc5ec669f3b4e9333fe by Serhiy Storchaka in branch 'master': bpo-15999: Always pass bool instead of int to socket.setblocking(). (GH-15621) https://github.com/python/cpython/commit/5eca7f3f3836cc734dfe8dc5ec669f3b4e9333fe

[issue15999] Using new 'bool' format character

2019-09-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset eb8974616bc58f44b2a3c3e4ca2326894ae42c8f by Serhiy Storchaka in branch 'master': bpo-15999: Always pass bool instead of int to the expat parser. (GH-15622) https://github.com/python/cpython/commit/eb8974616bc58f44b2a3c3e4ca2326894ae42c8f

[issue37994] Fix silencing all errors if an attribute lookup fails

2019-09-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +15303 pull_request: https://github.com/python/cpython/pull/15635 ___ Python tracker ___

[issue37994] Fix silencing all errors if an attribute lookup fails

2019-09-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 41c57b335330ff48af098d47e379e0f9ba09d233 by Serhiy Storchaka in branch 'master': bpo-37994: Fix silencing all errors if an attribute lookup fails. (GH-15630) https://github.com/python/cpython/commit/41c57b335330ff48af098d47e379e0f9ba09d233

[issue36543] Remove old-deprecated ElementTree features (part 2)

2019-09-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue36543] Remove old-deprecated ElementTree features (part 2)

2019-09-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset f02ea6225bc3b71bd5fe66224d199a6e3e23b14d by Serhiy Storchaka in branch 'master': bpo-36543: Remove old-deprecated ElementTree features. (GH-12707) https://github.com/python/cpython/commit/f02ea6225bc3b71bd5fe66224d199a6e3e23b14d --

[issue35771] IDLE: Fix tooltip Hovertiptest failure

2019-09-01 Thread Tal Einat
Change by Tal Einat : -- pull_requests: +15302 pull_request: https://github.com/python/cpython/pull/15634 ___ Python tracker ___

[issue24416] Return a namedtuple from date.isocalendar()

2019-09-01 Thread Dong-hee Na
Change by Dong-hee Na : -- pull_requests: +15301 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/15633 ___ Python tracker ___