[issue46799] ShareableList memory bloat and performance improvement

2022-03-27 Thread Ting-Che Lin
Ting-Che Lin added the comment: A gentle Ping to the multiprocessing lib maintainers. Is there anything else I can do to move this forward? -- resolution: -> remind ___ Python tracker <https://bugs.python.org/issu

[issue46799] ShareableList memory bloat and performance improvement

2022-02-27 Thread Ting-Che Lin
Ting-Che Lin added the comment: So I wrote a patch for this issue and published submitted a MR. When I was working on the patch, I realized that there is another issue related to how string and byte array size alignment is calculated. As seen here: https://github.com/python/cpython/blob

[issue46799] ShareableList memory bloat and performance improvement

2022-02-21 Thread Ting-Che Lin
Change by Ting-Che Lin : -- keywords: +patch pull_requests: +29597 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31467 ___ Python tracker <https://bugs.python.org/issu

[issue46799] ShareableList memory bloat and performance improvement

2022-02-19 Thread Ting-Che Lin
New submission from Ting-Che Lin : The current implementation of ShareableList keeps an unnecessary list of offsets in self._allocated_offsets. This list could have a large memory footprint if the number of items in the list is high. Additionally, this list will be copied in each process

[issue44710] Unexpected behavior in empty class with pass (Python 3.7.3)

2021-07-23 Thread Cheuk Ting Ho
Cheuk Ting Ho added the comment: Thank you, Serhiy for explaining that to me. I am closing it now since it is not a bug. -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/i

[issue44710] Unexpected behavior in empty class with pass (Python 3.7.3)

2021-07-22 Thread Cheuk Ting Ho
New submission from Cheuk Ting Ho : Demo example: === class MyType(type): def __init__(cls, name, bases, nmspc): if "__annotations__" in nmspc: annotations = nmspc["__annotations__"] else: nm

[issue36661] Missing dataclass decorator import in dataclasses module docs

2019-06-26 Thread Cheuk Ting Ho
Cheuk Ting Ho added the comment: I agree that for the more confusing ones, it would be better to write out the import statement explicitly. -- nosy: +Cheukting ___ Python tracker <https://bugs.python.org/issue36

[issue28506] Multiprocessing Pool starmap - struct.error: 'i' format requires -2e10<=n<=2e10

2016-10-22 Thread Justin Ting
Justin Ting added the comment: Actually, on further inspection, I seem to be having a slightly different problem with the same error that I initially described now. Even after modifying my code so that each python forked off to another process was only given the following arguments: args

[issue28506] Multiprocessing Pool starmap - struct.error: 'i' format requires -2e10<=n<=2e10

2016-10-22 Thread Justin Ting
Justin Ting added the comment: Ah, should have picked that up, coding at 3:30am doesn't do wonders for keeping a clear head. Thanks Tim, I'll keep that in mind! *Justin Ting* *E* justingl...@gmail.com | *M* +61 424 751 665 | *L* *https://au.linkedin.com/in/justinyting <https://au.linkedin.

[issue28506] Multiprocessing Pool starmap - struct.error: 'i' format requires -2e10<=n<=2e10

2016-10-22 Thread Justin Ting
New submission from Justin Ting: Multiprocessing is throwing this error when dealing with large amounts of data (all floating points an integers), but none of which exceeds the number boundaries in the error that it throws: File "/root/anaconda3/lib/python3.5/multiprocessing/pool.py&q

Is there a way to execute shell commands on VMWare server via PyVMomi?

2015-02-11 Thread Johnny Ting Shi
We have some VM running on top of EXSi. We want to be to run some remote arbitrary commands on the VM, anyone has experience with https://github.com/vmware/pyvmomi? which command do i need to call? Thanks -- https://mail.python.org/mailman/listinfo/python-list

[issue16827] Remove the relatively advanced content from section 2 in tutorial

2014-03-17 Thread Ya-Ting Huang
Ya-Ting Huang added the comment: Hi I just uploaded my patch. I add one file appendix.rst, and move every part except 2.1 and 2.2.3 to appendix. Also I add one line under the interactive section to advice readers see more information in appendix. Please let me know if I should reorganize

[issue17006] Warn users about hashing secrets?

2014-03-13 Thread Ya-Ting Huang
Ya-Ting Huang added the comment: Hi. this is my first patch. I tried to follow the instruction by David to add Christian's notes into a new security section. -- nosy: +yating.huang Added file: http://bugs.python.org/file34406/hashlib.patch

Re: re.sub(): replace longest match instead of leftmost match?

2011-12-19 Thread ting
On Dec 16, 11:49 am, John Gordon gor...@panix.com wrote: I'm working with IPv6 CIDR strings, and I want to replace the longest match of (:|$)+ with :.  But when I use re.sub() it replaces the leftmost match, even if there is a longer match later in the string. Typically this means that

Re: Make a small function thread safe

2011-12-19 Thread ting
On Dec 16, 8:21 am, Brad Tilley kj4...@gmail.com wrote: A thread locks the function on entrance and then releases it on exit. What is the equivalent way to do this in Python? I'm not sure if this applies in your case, but much of the time, you can use thread local storage, rather thread

Re: Doctest failing

2011-09-10 Thread ting
On Sep 10, 7:47 am, Peter Otten __pete...@web.de wrote: Tigerstyle wrote: I'm strugglin with some homework stuff and am hoping you can help me out here. This is the code: small_words = ('into', 'the', 'a', 'of', 'at', 'in', 'for', 'on')     new_title = []     title_split =

Re: List comprehension timing difference.

2011-09-02 Thread ting
On Sep 2, 9:54 am, Bart Kastermans bkast...@gmail.com wrote: if d(a,b) == 1 and a b: It will probably be faster if you reverse the evaluation order of that expression. if ab and d(a,b)==1: That way the d() function is called less than half the time. Of course this assumes that ab is a faster

Run time default arguments

2011-08-25 Thread ting
What is the most common way to handle default function arguments that are set at run time, rather than at compile time? The snippet below is the current technique that I've been using, but it seems inelegant. defaults = { 'debug' : false } def doSomething (debug = None): debug = debug if

Re: Run time default arguments

2011-08-25 Thread ting
On Aug 25, 10:35 am, Arnaud Delobelle arno...@gmail.com wrote: You're close to the usual idiom: def doSomething(debug=None):     if debug is None:         debug = defaults['debug']     ... Note the use of 'is' rather than '==' HTH Hmm, from what you are saying, it seems like there's no

Re: is there any principle when writing python function

2011-08-25 Thread ting
On Aug 23, 7:59 am, smith jack thinke...@gmail.com wrote: i have heard that function invocation in python is expensive, but make lots of functions are a good design habit in many other languages, so is there any principle when writing python function? for example, how many lines should form a