[issue39110] UserList-subclass Tree slicing changes the original list unexpectedly

2019-12-20 Thread Tarn Yeong Ching
Tarn Yeong Ching added the comment: and more... It doesn't happen when Tree directly subclasses list. -- ___ Python tracker ___

[issue39110] UserList-subclass Tree slicing changes the original list unexpectedly

2019-12-20 Thread ctarn
ctarn added the comment: Moreover, it works as expected with Python 3.6 (the owner of each of them is d), and Python 3.8 and Python 3.7 work differently. I didn't try it using Python 3.9 yet. -- versions: +Python 3.7 -Python 3.9 ___ Python tracker

[issue39110] UserList-subclass Tree slicing changes the original list unexpectedly

2019-12-20 Thread ctarn
Change by ctarn : Removed file: https://bugs.python.org/file48797/bug.py ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue39110] UserList-subclass Tree slicing changes the original list unexpectedly

2019-12-20 Thread ctarn
ctarn added the comment: I tried to remove list(), and just use cmd like `_ = d[0:1]`, and it surprisingly changed d[0].owner from d to d[0:1]! The file attached is updated. I pretty sure that it is a (serious) bug. Please check it more carefully. Thanks. -- title: UserList-subclass

[issue39113] PyUnicode_AsUTF8AndSize Sometimes Segfaults With Incomplete Surrogate Pair

2019-12-20 Thread william.ayd
william.ayd added the comment: Hmm my mistake - thanks! -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

Re: How to combine a group of lists together

2019-12-20 Thread wanghao7915
Thanks! Actually, I neglected that my "print" is in the "for", so I get a group of lists. Now I put the "print" out of the iteration then use .extend to append each list I produce. Finally, print and get my ideal result. Haha, I'm too naive, so is my English. --

Re: How to combine a group of lists together

2019-12-20 Thread wanghao7915
thanks for responding! Now I've solved this problem! My former code is: for j in data: spe = j.get_text() l_spe = spe.split() print(l_spe) Then I get the result: ['$278.86as', 'of', 'Dec', '20,', '2019,', '06:47', 'PST', '-', 'Details'] ['4.7', 'inches'] ['750', 'x', '1334']

[issue24945] Expose Py_TPFLAGS_ values from Python

2019-12-20 Thread Batuhan
Batuhan added the comment: IMHO inspect would be a better place to put these constants (like CO_ flags). -- nosy: +BTaskaya versions: +Python 3.9 -Python 3.6 ___ Python tracker

[issue13047] imp.find_module("") and imp.find_module(".")

2019-12-20 Thread Batuhan
Batuhan added the comment: `imp` is now deprecated and IMHO no reason to make this change after this deprecation. -- nosy: +BTaskaya ___ Python tracker ___

[issue36051] Drop the GIL during large bytes.join operations?

2019-12-20 Thread Batuhan
Change by Batuhan : -- versions: +Python 3.9 -Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36051] Drop the GIL during large bytes.join operations?

2019-12-20 Thread Batuhan
Change by Batuhan : -- nosy: +BTaskaya, vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33772] Fix few dead code paths

2019-12-20 Thread Batuhan
Batuhan added the comment: I agree, can be closed -- nosy: +BTaskaya ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue39106] Add suggestions to argparse error message output for unrecognized arguments

2019-12-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: -1 Given an unknown argument, we really can't know what the user intended. The usage string already lists all available options and -h --help gives more detail when requested. -- ___ Python tracker

Re: How to extend an object?

2019-12-20 Thread DL Neil via Python-list
On 21/12/19 2:50 pm, Greg Ewing wrote: On 21/12/19 1:59 am, Stefan Ram wrote:    I would like to add a method to a string.    This is not possible in Python? It's not possible. Built-in classes can't have methods added to them. You can define your own subclass of str and give it whatever

Re: How to combine a group of lists together

2019-12-20 Thread DL Neil via Python-list
On 21/12/19 6:04 pm, wanghao7...@gmail.com wrote: I utilized .get_text() + .split() functions and obtain this: spe= ['$278.86as', 'of', 'Dec', '20,', '2019,', '06:47', 'PST', '-', 'Details'] ['4.7', 'inches'] ['750', 'x', '1334'] ['64', 'GB'] ['2', 'GB'] ['Apple', 'A11', 'Bionic,', 'Hexa-Core,',

[issue39113] PyUnicode_AsUTF8AndSize Sometimes Segfaults With Incomplete Surrogate Pair

2019-12-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Your function returns a borrowed reference. It xiuld cause ceash even without calling PyUnicode_AsUTF8AndSize. Add Py_INCREF(str) -- nosy: +serhiy.storchaka resolution: -> not a bug ___ Python tracker

Re: How to combine a group of lists together

2019-12-20 Thread Cameron Simpson
On 20Dec2019 21:04, wanghao7...@gmail.com wrote: I utilized .get_text() + .split() functions and obtain this: spe= ['$278.86as', 'of', 'Dec', '20,', '2019,', '06:47', 'PST', '-', 'Details'] ['4.7', 'inches'] ['750', 'x', '1334'] ['64', 'GB'] ['2', 'GB'] ['Apple', 'A11', 'Bionic,', 'Hexa-Core,',

How to combine a group of lists together

2019-12-20 Thread wanghao7915
I utilized .get_text() + .split() functions and obtain this: spe= ['$278.86as', 'of', 'Dec', '20,', '2019,', '06:47', 'PST', '-', 'Details'] ['4.7', 'inches'] ['750', 'x', '1334'] ['64', 'GB'] ['2', 'GB'] ['Apple', 'A11', 'Bionic,', 'Hexa-Core,', '(2x', 'Monsoon', '+', '4x', 'Mistral)'] ['5.22',

[issue39110] UserList-subclass Tree slicing changes node attribute

2019-12-20 Thread ctarn
Change by ctarn : -- resolution: not a bug -> ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39110] UserList-subclass Tree slicing changes node attribute

2019-12-20 Thread ctarn
ctarn added the comment: Sorry but it is not. See the first time I print ls[4].owner. We get d as expected, not a slice of d, that is, d[0:2]. However the next time we print it after _ = list(d[0:1]), noticed that ls[4] == d[0:1], we get d[0:1], it’s extremely surprising!!! I have to

[issue39113] PyUnicode_AsUTF8AndSize Sometimes Segfaults With Incomplete Surrogate Pair

2019-12-20 Thread william.ayd
New submission from william.ayd : With the attached extension module, if I run the following in the REPL: >>> import libtest >>> >>> libtest.error_if_not_utf8("foo") 'foo' >>> libtest.error_if_not_utf8("\ud83d") Traceback (most recent call last): File "", line 1, in UnicodeEncodeError:

Re: How to extend an object?

2019-12-20 Thread Greg Ewing
On 21/12/19 1:59 am, Stefan Ram wrote: I would like to add a method to a string. This is not possible in Python? It's not possible. Built-in classes can't have methods added to them. You can define your own subclass of str and give it whatever methods you want. But in your case: for

[issue39108] random needs doc for "gauss" versus "normalvariate"

2019-12-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: I can make the update for you. -- assignee: docs@python -> rhettinger ___ Python tracker ___

[issue39112] Misleading documentation for tuple

2019-12-20 Thread Simon Berens
New submission from Simon Berens : Sorry if this is a silly question (my first bug report), but it seems that https://docs.python.org/3/library/functions.html#func-tuple should say "class tuple" instead of just "tuple", as list, dict, and set do. -- assignee: docs@python components:

[issue39111] Misleading documentation for NotImplemented

2019-12-20 Thread Steven D'Aprano
Change by Steven D'Aprano : -- title: Misleading documentation -> Misleading documentation for NotImplemented ___ Python tracker ___

[issue39111] Misleading documentation

2019-12-20 Thread Steven D'Aprano
Steven D'Aprano added the comment: The behaviour is correct: `==` should not raise, even if both objects' `__eq__` method returns NotImplemented. I agree that the documentation needs improvement. Looking at the current version:

[issue36476] Runtime finalization assumes all other threads have exited.

2019-12-20 Thread Eric Snow
Eric Snow added the comment: So I see 3 things to address here: 1. Python daemon threads 2. Python threads created in atexit handlers 3. non-Python threads accessing the C-API Possible solutions (starting point for discussion): 1. stop them at the point we stop waiting for non-daemon

[issue36476] Runtime finalization assumes all other threads have exited.

2019-12-20 Thread Eric Snow
Eric Snow added the comment: To put it another way: (from issue33608#msg358748) > The docs [1] aren't super clear about it, but there are some fundamental > assumptions we make about runtime finalization: > > * no use of the C-API while Py_FinalizeEx() is executing (except for a > few

[issue36476] Runtime finalization assumes all other threads have exited.

2019-12-20 Thread Eric Snow
Eric Snow added the comment: Analysis by @pconnell: * https://bugs.python.org/issue33608#msg357169 * https://bugs.python.org/issue33608#msg357170 * https://bugs.python.org/issue33608#msg357179 tl;dr daemon threads and external C-API access during/after runtime finalization are causing

[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-12-20 Thread Eric Snow
Eric Snow added the comment: Thanks for the detailed analysis, Phil. I think the results are pretty conclusive: daemon threads are the worst. :) But seriously, thanks. As you demonstrated, it isn't just Python "daemon" threads that cause the problem. It is essentially any external access

[issue36476] Runtime finalization assumes all other threads have exited.

2019-12-20 Thread Eric Snow
Change by Eric Snow : -- nosy: +pconnell ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36476] Runtime finalization assumes all other threads have exited.

2019-12-20 Thread Eric Snow
Eric Snow added the comment: Problems with lingering threads during/after runtime finalization continue to be a problem. I'm going to use this issue as the focal point for efforts to resolve this. Related issues: * #36479 "Exit threads when interpreter is finalizing rather than runtime."

[issue24770] Py_Finalize() doesn't stop daemon threads

2019-12-20 Thread Eric Snow
Eric Snow added the comment: I'm closing this in favor of #36476 "Runtime finalization assumes all other threads have exited." -- nosy: +eric.snow resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Runtime finalization assumes all other threads have

[issue36476] Runtime finalization assumes all other threads have exited.

2019-12-20 Thread Eric Snow
Change by Eric Snow : -- stage: -> needs patch versions: +Python 3.9 -Python 3.7 ___ Python tracker ___ ___ Python-bugs-list

[issue36476] Runtime finalization assumes all other threads have exited.

2019-12-20 Thread Eric Snow
Eric Snow added the comment: Adding to the list: * any OS threads created by an extension module or embedding application -- ___ Python tracker ___

[issue13077] Unclear behavior of daemon threads on main thread exit

2019-12-20 Thread Eric Snow
Change by Eric Snow : -- nosy: +eric.snow ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34296] Speed up python startup by pre-warming the vm

2019-12-20 Thread Eric Snow
Change by Eric Snow : -- nosy: +eric.snow ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31517] MainThread association logic is fragile

2019-12-20 Thread Eric Snow
Eric Snow added the comment: probably a duplicate: issue #39042 "Use the runtime's main thread ID in the threading module." -- ___ Python tracker ___

[issue14073] allow per-thread atexit()

2019-12-20 Thread Eric Snow
Change by Eric Snow : -- nosy: +eric.snow ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28812] Deadlock between GIL and pystate head_mutex.

2019-12-20 Thread Eric Snow
Change by Eric Snow : -- nosy: +eric.snow ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1332869] Fatal Python error: Interpreter not initialized

2019-12-20 Thread Eric Snow
Change by Eric Snow : -- nosy: +eric.snow ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1596321] KeyError at exit after 'import threading' in other thread

2019-12-20 Thread Eric Snow
Eric Snow added the comment: related: issue #39042 "Use the runtime's main thread ID in the threading module." -- nosy: +eric.snow ___ Python tracker ___

[issue39102] Increase Enum performance

2019-12-20 Thread Arseny Boykov
Arseny Boykov added the comment: Also, do we need to leave compatibility with python <3.8? If not, we could use the fact that python 3.8 dicts and sets which are preserve order to speed things up even more. Also I'd replace % string formatting with f-strings, as they also faster. And

Re: Unable to install "collect" via pip3

2019-12-20 Thread Barry
> On 20 Dec 2019, at 15:27, Mahmood Naderan via Python-list > wrote: > > Hi > > I can install collect with pip for python2.7 > $ pip install --user collect > Collecting collect > Using cached >

[issue39110] UserList-subclass Tree slicing changes node attribute

2019-12-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: (ctarn), if you want to discuss what you are doing further, please try a discussion list, such as python-list. -- nosy: +terry.reedy ___ Python tracker

[issue39110] UserList-subclass Tree slicing changes node attribute

2019-12-20 Thread Terry J. Reedy
Change by Terry J. Reedy : -- stage: -> resolved status: pending -> closed ___ Python tracker ___ ___ Python-bugs-list mailing

[issue39110] UserList-subclass Tree slicing changes node attribute

2019-12-20 Thread Terry J. Reedy
Change by Terry J. Reedy : -- status: open -> pending ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39110] UserList-subclass Tree slicing changes node attribute

2019-12-20 Thread Terry J. Reedy
Change by Terry J. Reedy : -- status: pending -> open title: It seems that list() changes the value of the parameter -> UserList-subclass Tree slicing changes node attribute ___ Python tracker

[issue39108] random needs doc for "gauss" versus "normalvariate"

2019-12-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: You could start by posting suggested new text here. -- nosy: +terry.reedy title: Documentation for "random.gauss" vs "random.normalvariate" is lacking -> random needs doc for "gauss" versus "normalvariate" versions: -Python 3.5, Python 3.6

[issue39102] Increase Enum performance

2019-12-20 Thread Terry J. Reedy
Change by Terry J. Reedy : -- versions: -Python 3.6, Python 3.7, Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue39098] OSError: handle closed, ProcessPoolExecutor shutdown(wait=False)

2019-12-20 Thread Terry J. Reedy
Change by Terry J. Reedy : -- title: OSError: handle is closed in ProcessPoolExecutor on shutdown(wait=False) -> OSError: handle closed, ProcessPoolExecutor shutdown(wait=False) ___ Python tracker

[issue39096] "Format Specification Mini-Language" doc mistake for Decimal

2019-12-20 Thread Terry J. Reedy
Change by Terry J. Reedy : -- title: Description of "Format Specification Mini-Language" not accurate for Decimal -> "Format Specification Mini-Language" doc mistake for Decimal ___ Python tracker

[issue39062] ValueError in TarFile.getmembers

2019-12-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: jvoisin, please consider rerunning such reproducers with lastest 3.8 and 3.9 before submitting. It is much easier for you to do so when you have the fuzz file, script, and command line already present. -- ___

[issue39062] ValueError in TarFile.getmembers

2019-12-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: jvoisin, what do you consider to be the bug? Raising an exception is exactly the right thing to do on bad input. I leave it to others to decide if this should be closed as 'not a bug' or if the internal exception should be caught and replaced. We don't

[issue39062] ValueError in TarFile.getmembers

2019-12-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: See #39065, #39067 for similar tarfile issues. -- nosy: +terry.reedy ___ Python tracker ___ ___

[issue39062] ValueError in TarFile.getmembers

2019-12-20 Thread Terry J. Reedy
Change by Terry J. Reedy : -- nosy: +lars.gustaebel, serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue39060] asyncio.Task.print_stack doesn't print the full stack

2019-12-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: Amit, is there a simple doc change that would have made the result clearer? (before getting Andrew's response?) -- nosy: +terry.reedy versions: +Python 3.8, Python 3.9 ___ Python tracker

[issue39048] Reorder __aenter__ & __aexit__ checks for async with statement

2019-12-20 Thread Terry J. Reedy
Change by Terry J. Reedy : -- title: Reorder the __aenter__ and __aexit__ method checks for the async with statement -> Reorder __aenter__ & __aexit__ checks for async with statement versions: +Python 3.9 ___ Python tracker

Re: Unable to install "collect" via pip3

2019-12-20 Thread Terry Reedy
On 12/20/2019 2:22 AM, Mahmood Naderan via Python-list wrote: However, pip3 fails with this error $ pip3 install --user collect Collecting collect Using cached https://files.pythonhosted.org/packages/cf/5e/c0f0f51d081665374a2c219ea4ba23fb1e179b70dded96dc16606786d828/collect-0.1.1.tar.gz

Re: Problems with "Tarfile.close()"

2019-12-20 Thread Chris Angelico
On Sat, Dec 21, 2019 at 6:13 AM Peter Otten <__pete...@web.de> wrote: > > Dr Rainer Woitok wrote: > > > Ethan, > > > > On Friday, 2019-12-20 07:41:51 -0800, you wrote: > > > >> ... > >> In Python 3 `sys.stdout` is a character interface, not bytes. > > > > Does that mean that with Python 3

Re: on sorting things

2019-12-20 Thread Chris Angelico
On Sat, Dec 21, 2019 at 6:01 AM Peter Otten <__pete...@web.de> wrote: > > Chris Angelico wrote: > > > On Sat, Dec 21, 2019 at 5:03 AM Peter Otten <__pete...@web.de> wrote: > >> PS: If you are sorting files by size and checksum as part of a > >> deduplication effort consider using dict-s instead: >

[issue13305] datetime.strftime("%Y") not consistent for years < 1000

2019-12-20 Thread Paul Ganssle
Change by Paul Ganssle : -- versions: +Python 3.7, Python 3.8, Python 3.9 -Python 3.6 ___ Python tracker ___ ___ Python-bugs-list

[issue39103] [linux] strftime renders %Y with only 3 characters

2019-12-20 Thread Paul Ganssle
Paul Ganssle added the comment: This is a duplicate of issue 13305. Right now we have some shims around `strftime` to improve consistency in some situations and for other reasons, but mostly we just call the libc version. There is an open issue from 2008 (#3173) to ship our own

[issue38918] Add __module__ entry for function type in inspect docs table.

2019-12-20 Thread Eric Snow
Eric Snow added the comment: Thanks for working on this, @parthsharma2! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue38918] Add __module__ entry for function type in inspect docs table.

2019-12-20 Thread miss-islington
miss-islington added the comment: New changeset 44683bbc634bd007df572dce0d8bb348a469a6bb by Miss Islington (bot) in branch '3.8': bpo-38918: Add __module__ entry for function & method type in inspect docs table (GH-17408)

[issue38918] Add __module__ entry for function type in inspect docs table.

2019-12-20 Thread miss-islington
miss-islington added the comment: New changeset 0ffc90031cadf5637cfc13a40899e71c259c49b1 by Miss Islington (bot) in branch '3.7': bpo-38918: Add __module__ entry for function & method type in inspect docs table (GH-17408)

[issue38918] Add __module__ entry for function type in inspect docs table.

2019-12-20 Thread miss-islington
Change by miss-islington : -- pull_requests: +17136 pull_request: https://github.com/python/cpython/pull/17676 ___ Python tracker ___

[issue38918] Add __module__ entry for function type in inspect docs table.

2019-12-20 Thread miss-islington
Change by miss-islington : -- pull_requests: +17135 pull_request: https://github.com/python/cpython/pull/17675 ___ Python tracker ___

[issue23868] Uninitialized objects are tracked by the garbage collector

2019-12-20 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: In summary, a normal allocation for an object tracked by the Garbage collector follows these steps: 1.- Call PyObject_GC_New or PyObject_GC_NewVar or related APIs. 2.- Initialize everything and make sure the object is consistent. 3.- Call

[issue38918] Add __module__ entry for function type in inspect docs table.

2019-12-20 Thread miss-islington
miss-islington added the comment: New changeset f522a6ddb67a238bab5673608111f74ec4e22205 by Miss Islington (bot) (Parth Sharma) in branch 'master': bpo-38918: Add __module__ entry for function & method type in inspect docs table (GH-17408)

Re: Problems with "Tarfile.close()"

2019-12-20 Thread Peter Otten
Dr Rainer Woitok wrote: > Ethan, > > On Friday, 2019-12-20 07:41:51 -0800, you wrote: > >> ... >> In Python 3 `sys.stdout` is a character interface, not bytes. > > Does that mean that with Python 3 "Tarfile" is no longer able to write > the "tar" file to a pipe? Or is there now another

[issue23868] Uninitialized objects are tracked by the garbage collector

2019-12-20 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: If I understand what you say correctly, it does not seem correct, the object will only be tracked by the collector when you call PyObject_GC_Track. indeed, the documentation warns about this: void PyObject_GC_Track(PyObject *op)¶ Adds the object op to

[issue26845] Misleading variable name in exception handling

2019-12-20 Thread STINNER Victor
STINNER Victor added the comment: Variable names have no impact on the execution. Sometimes, it's called "exc", sometimes "val", sometimes "exc_val" :-) This issue is not a bug. -- resolution: -> not a bug stage: -> resolved status: open -> closed

Re: on sorting things

2019-12-20 Thread Peter Otten
Chris Angelico wrote: > On Sat, Dec 21, 2019 at 5:03 AM Peter Otten <__pete...@web.de> wrote: >> PS: If you are sorting files by size and checksum as part of a >> deduplication effort consider using dict-s instead: > > Yeah, I'd agree if that's the purpose. But let's say the point is to > have a

[issue39042] Use the runtime's main thread ID in the threading module.

2019-12-20 Thread Eric Snow
Eric Snow added the comment: I don't see a reason not to consider this is a regression. The only problem with the fix would be for any users that rely on the inaccurate reporting of the threading module. Considering that possibly includes only some embedders (and folks using _thread module

[issue39102] Increase Enum performance

2019-12-20 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- nosy: +levkivskyi ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39046] collections.abc.Reversible should not be a subclass of Hashable

2019-12-20 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- nosy: +levkivskyi ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39111] Misleading documentation

2019-12-20 Thread Murali Ganapathy
Murali Ganapathy added the comment: === # python3 class Base: def __eq__(self, other): print("base called") return super().__eq__(other) class Foo(Base): def __eq__(self, other): print("foo called") return NotImplemented Foo() == Foo() # foo called # foo called False

Re: Cython, producing different modules from the same .pyx

2019-12-20 Thread Lele Gaifax
Ethan Furman writes: > If you don't get an answer here, you can try the Cython Users group: Thanks, reposted the same question there. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.

Re: Cython, producing different modules from the same .pyx

2019-12-20 Thread Lele Gaifax
Greg Ewing writes: > You could try creating a set of top-level .pyx stubs, each of > which just 'include' the real code. Thank you, will try this approach! ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi

Re: on sorting things

2019-12-20 Thread Chris Angelico
On Sat, Dec 21, 2019 at 5:03 AM Peter Otten <__pete...@web.de> wrote: > PS: If you are sorting files by size and checksum as part of a deduplication > effort consider using dict-s instead: Yeah, I'd agree if that's the purpose. But let's say the point is to have a guaranteed-stable ordering of

[issue39110] It seems that list() changes the value of the parameter

2019-12-20 Thread Eric Snow
Eric Snow added the comment: Your problem is with UserList. This is from the implementation: def __getitem__(self, i): if isinstance(i, slice): return self.__class__(self.data[i]) else: return self.data[i] So each slice is creating a new Tree.

Re: on sorting things

2019-12-20 Thread Peter Otten
Eli the Bearded wrote: > In comp.lang.python, Peter Otten <__pete...@web.de> wrote: >> Eli the Bearded wrote: >>> But what caught my eye most, as someone relatively new to Python but >>> with long experience in C in Perl, is sorting doesn't take a > > s/C in /C and/ > > Ugh. > >>>

[issue26767] Inconsistant error messages for failed attribute modification

2019-12-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Not all error messages contain an attribute name, an object type name and a reason. -- ___ Python tracker ___

[issue39111] Misleading documentation

2019-12-20 Thread Brett Cannon
Brett Cannon added the comment: And to be more specific, == is guaranteed to work by falling back to object.__eq__() which falls back to object identity if the object doesn't have a custom __eq__() method. -- ___ Python tracker

[issue39111] Misleading documentation

2019-12-20 Thread Brett Cannon
Brett Cannon added the comment: This is because your class implicitly inherits from object and object.__eq__() is implemented and does not return NotImplemented. -- nosy: +brett.cannon resolution: -> not a bug stage: -> resolved status: open -> closed

[issue39103] [linux] strftime renders %Y with only 3 characters

2019-12-20 Thread Brett Cannon
Brett Cannon added the comment: Due note, though, that there's a difference in the implementation of strftime versus strptime, as the former (at least the last time I looked ages ago) uses the libc version of the function and thus probably doesn't try to smooth out differences like this,

Re: Problems with "Tarfile.close()"

2019-12-20 Thread Dr Rainer Woitok
Ethan, On Friday, 2019-12-20 07:41:51 -0800, you wrote: > ... > In Python 3 `sys.stdout` is a character interface, not bytes. Does that mean that with Python 3 "Tarfile" is no longer able to write the "tar" file to a pipe? Or is there now another way to write to a pipe? And if that new

Re: [HN] How to Make Python Wait

2019-12-20 Thread p4j
>> https://news.ycombinator.com/item?id=21834408 > Did you just post a blog article, then spam everywhere to try to get > traffic, where your entire blog post is telling people worse ways to > do a time.sleep()? Blog post is not mine. I have a habit of posting good things to HN. When I got

[issue39107] Consider building Tkinter with Tk 8.6.10

2019-12-20 Thread Zachary Ware
Zachary Ware added the comment: Looks like some enhancements on Windows as well; we should upgrade at least 3.9. -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker

[issue39105] Spam

2019-12-20 Thread Zachary Ware
Change by Zachary Ware : -- type: resource usage -> versions: -Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue39105] Spam

2019-12-20 Thread Zachary Ware
Change by Zachary Ware : -- Removed message: https://bugs.python.org/msg358698 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue39105] Spam

2019-12-20 Thread Zachary Ware
Change by Zachary Ware : Removed file: https://bugs.python.org/file48795/Roko-Logo-2-fi18353094x260.png ___ Python tracker ___ ___

[issue39111] Misleading documentation

2019-12-20 Thread Murali Ganapathy
New submission from Murali Ganapathy : The documentation at https://docs.python.org/3.6/library/constants.html#NotImplemented states If all attempts return NotImplemented, the interpreter will raise an appropriate exception. However this is not true for __eq__. === class Foo: def

[issue34938] Fix mimetype.init() to account for from import

2019-12-20 Thread YoSTEALTH
YoSTEALTH added the comment: I didn't receive any notification of replay on this topic. `_default_mime_types()` should never have been a function. This function should be safe to remove as its an internal function. This would avoid unneeded function call and globals used. Stuff like

[issue26767] Inconsistant error messages for failed attribute modification

2019-12-20 Thread Batuhan
Batuhan added the comment: > I think it would be nice to unify error messages and make them more specific. How can they can be more specific when they are unified? -- nosy: +BTaskaya versions: +Python 3.9 -Python 3.6 ___ Python tracker

[issue26845] Misleading variable name in exception handling

2019-12-20 Thread Batuhan
Batuhan added the comment: I am not sure if calls like this constitutes a problem. By the way most of the things changed in Python/ceval.c including removal of END_FINALLY (issue 33387) but calls to _PyErr_Restore is still there with that same arguments. -- nosy: +BTaskaya, vstinner

[issue23868] Uninitialized objects are tracked by the garbage collector

2019-12-20 Thread Batuhan
Change by Batuhan : -- nosy: +BTaskaya, pablogsal type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue18930] os.spawnXX functions terminates process if second argument is empty list

2019-12-20 Thread Batuhan
Batuhan added the comment: @SSchukat can you reproduce this issue in python 3? -- components: +Windows -Interpreter Core nosy: +BTaskaya, paul.moore, steve.dower, tim.golden, zach.ware type: -> behavior ___ Python tracker

Re: How to improve epoll speed when recv from kernel via netlink?

2019-12-20 Thread Barry Scott
> On 20 Dec 2019, at 04:33, lampahome wrote: > > I tried to receive msg from kernel via netlink of socket. > > And I use epoll to receive netlink events whenever it comes from kernel to > user space. > > But I found the performance is poor e.g. epoll costs 90% time of execution > time after

  1   2   >