[issue672115] Assignment to __bases__ of direct object subclasses

2016-07-11 Thread Memeplex
Memeplex added the comment: I understand Michael's comment http://bugs.python.org/issue672115#msg14169 but I'm failing to see how it's directly related to this issue: as Michael himself said it's even relevant for the object-subclass-object hack or for any hierarchy whatsoever. Is the comment

[issue27274] [ctypes] Allow from_pointer creation

2016-07-10 Thread Memeplex
Memeplex added the comment: As usual, thank you for the detailed and informative answer, Eryk. I think I understand your points but I decided to do it the way I did it because: 1. I sometimes need the array itself. For example, some of my clases contains or inherits from a ctypes structure

[issue27274] [ctypes] Allow from_pointer creation

2016-07-09 Thread Memeplex
Memeplex added the comment: I have been happily using this helper function: def c_array(*args): if type(args[1]) is int: ptr, size = args return (ptr._type_ * size).from_address(ct.addressof(ptr.contents)) else: c_type, buf = args return (c_type * (len

[issue26894] Readline not aborting line edition on sigint

2016-06-30 Thread Memeplex
Memeplex added the comment: Martin: I can't reproduce the issue by just importing matplotlib with the TkAgg backend into a vanilla python repl. I will try to isolate the problem when I have some free time. -- status: pending -> open ___ Pyt

[issue27303] [argparse] Unify options in help output

2016-06-12 Thread Memeplex
Memeplex added the comment: Thank you for the tips, Paul. The issue is related to the default behavior but it's always good to know about handy workarounds and extensibility hooks. -- ___ Python tracker <rep...@bugs.python.org>

[issue27303] [argparse] Unify options in help output

2016-06-12 Thread Memeplex
Changes by Memeplex <carlosjosep...@gmail.com>: -- type: -> enhancement ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27303> ___ _

[issue27303] [argparse] Unify options in help output

2016-06-12 Thread Memeplex
New submission from Memeplex: Currently when you specify more than one name for an option (typically short and long versions) each name is listed with its entire arg list. This is annoying for options taking many args or choices, for example: --type {html,pdf,github,blogger}, -t {html,pdf

[issue26565] [ctypes] Add value attribute to non basic pointers.

2016-06-11 Thread Memeplex
Memeplex added the comment: Martin, there were two reasons: 1. Conciseness: addressof(p.contents) vs. p.value. 2. Uniformity: I expect the value of a pointer to be the address it points to. Then Eryk pointed out that p.value has already another meaning for simple pointer types, so (2) can't

[issue27274] [ctypes] Allow from_pointer creation

2016-06-09 Thread Memeplex
Memeplex added the comment: > The first argument can be any type accepted by c_void_p.from_param, such as a > ctypes pointer/array, str, bytes, or an integer address. Now I see why you suggested ptr.as_void in 26565. Both issues are very related. Some functions are overloaded in the

[issue27274] [ctypes] Allow from_pointer creation

2016-06-09 Thread Memeplex
Memeplex added the comment: Thank you for the great tips, Eryk, somehow I overlooked string_at while reading the docs. Now, given that the address parameter of string_at is pretty overloaded, wouldn't it be reasonable to overload from_address the same instead of introducing from_pointer

[issue27274] [ctypes] Allow from_pointer creation

2016-06-08 Thread Memeplex
Memeplex added the comment: I would like to add some information about my use case. Many c structs have pointers to arrays of data plus some field indicating the length of those arrays. Sometimes I need to pickle that kind of structs and a bytes object has to somehow be created from each

[issue26565] [ctypes] Add value attribute to non basic pointers.

2016-06-08 Thread Memeplex
Memeplex added the comment: Related: http://bugs.python.org/issue27274. Maybe ptr.toaddress? As opposed to addressof(ptr). I think ptr.address might be confusing as it's intutive meaning is closer to addressof(ptr). -- ___ Python tracker <

[issue27274] [ctypes] Allow from_pointer creation

2016-06-08 Thread Memeplex
New submission from Memeplex: This real life example is pretty terrible: (ct.c_float * self._nfeats).from_address( ct.addressof(self._vals.contents)) The alternative of casting the pointer to pointer-to-array, then pick ptr.contents is not really better. What about a from_pointer(ptr

[issue27221] [multiprocessing] Doc is outdated regarding method picklability

2016-06-04 Thread Memeplex
New submission from Memeplex: The module documentation recommends... More picklability Ensure that all arguments to Process.__init__() are picklable. This means, in particular, that bound or unbound methods cannot be used directly as the target (unless you use the fork start method) — just

[issue27098] Pickle of memoryview not raising error

2016-05-23 Thread Memeplex
New submission from Memeplex: In [1]: mv = memoryview(b'123') In [2]: mv.__reduce__() TypeError: can't pickle memoryview objects But then: In [3]: pickle.dumps(mv) b'\x80\x03cbuiltins\nmemoryview\nq\x00)\x81q\x01.' Even worse: In [4]: pickle.loads(pickle.dumps(mv)) TypeError

[issue26894] Readline not aborting line edition on sigint

2016-04-30 Thread Memeplex
New submission from Memeplex: Maybe this is just a bug in ipython but as it's closely related to http://bugs.python.org/issue23735 I'm reporting it here too, just in case. -- My original report to bug-readline: using readline with ipython 4.1.2 and the TkAgg (or GTK3Agg) backend

[issue26565] [ctypes] Add value attribute to non basic pointers.

2016-03-14 Thread Memeplex
New submission from Memeplex: I know one can do addressof(p.contents), but it's a bit inconsistent that c_void_p and c_char_p contain the same information in the value attribute. -- components: ctypes messages: 261794 nosy: memeplex priority: normal severity: normal status: open title

[issue26541] Add stop_after parameter to setup()

2016-03-11 Thread Memeplex
New submission from Memeplex: The current implementation offers a stop_after parameter for run_setup() but not for setup(). This design has some shortcomings: 1. It couples the possibility to stop setup after some phase to the fact that the setup function resides in another file

[issue26510] [argparse] Add required argument to add_subparsers

2016-03-08 Thread Memeplex
Changes by Memeplex <carlosjosep...@gmail.com>: -- nosy: +bethard ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26510> ___ __

[issue26510] [argparse] Add required argument to add_subparsers

2016-03-08 Thread Memeplex
Changes by Memeplex <carlosjosep...@gmail.com>: -- title: Add required argument to add_subparsers -> [argparse] Add required argument to add_subparsers ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

[issue26510] Add required argument to add_subparsers

2016-03-08 Thread Memeplex
New submission from Memeplex: It's useful in combination with dest. Currently you have to set required as an attribute. This is not only inconsistent but not even documented as a valid usage (in general, it's not clear from the docs whether attribute setting -vs argument passing- is a valid

[issue26372] Popen.communicate not ignoring BrokenPipeError

2016-02-16 Thread Memeplex
New submission from Memeplex: When not using a timeout, communicate will raise a BrokenPipeError if the command returns an error code. For example: sp = subprocess.Popen('cat --not-an-option', shell=True, stdin=subprocess.PIPE) time.sleep(.2) sp.communicate(b'hi\n') This isn't consistent

[issue25509] PyImport_ImportModule inaccurately described

2015-10-31 Thread Memeplex
Memeplex added the comment: Well it's like that since 2.1 so I guess the doc is wrong indeee. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue25509] PyImport_ImportModule inaccurately described

2015-10-31 Thread Memeplex
Memeplex added the comment: Brett, I'm not sure about that, notice that the "import hook" as is mentioned in the docs is just the current __import__ in the builtins module (which could have been replaced and in this sense would be a "hook") but not proper import hooks.

[issue25509] PyImport_ImportModule inaccurately described

2015-10-29 Thread Memeplex
New submission from Memeplex: The documentation (for 3.5) states that "[PyImport_ImportModule] is a simplified interface to PyImport_ImportModuleEx()" but the current implementation calls PyImport_Import instead, which is a higher level interface that takes into account import ho

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2015-09-29 Thread Memeplex
Memeplex added the comment: Here is another manifestation of this problem: http://bugs.python.org/issue17050 -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2015-09-28 Thread Memeplex
Memeplex added the comment: What's missing for this patch to be applied? Can I help somehow? -- nosy: +memeplex ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/

[issue13812] multiprocessing package doesn't flush stderr on child exception

2015-08-27 Thread Memeplex
Memeplex added the comment: I would like to reopen this issue because of the following, very related, behavior. Try this: ``` import multiprocessing as mp import time def g(): time.sleep(100) def f(): mp.Process(target=g).start() 1/0 mp.Process(target=f).start() ``` It won't

[issue13812] multiprocessing package doesn't flush stderr on child exception

2015-08-27 Thread Memeplex
Changes by Memeplex carlosjosep...@gmail.com: -- versions: +Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13812

[issue24948] Multiprocessing not timely flushing stack trace to stderr

2015-08-27 Thread Memeplex
New submission from Memeplex: Related to but not the same than https://bugs.python.org/issue13812. Try this: ``` import multiprocessing as mp import time def g(): time.sleep(100) def f(): mp.Process(target=g).start() 1/0 mp.Process(target=f).start() ``` It won't show

[issue24948] Multiprocessing not timely flushing stack trace to stderr

2015-08-27 Thread Memeplex
Memeplex added the comment: One possible fix to multiprocessing/process.py: try: self.run() exitcode = 0 finally: util._exit_function() --- self.run() exitcode = 0 274a272 util

[issue13812] multiprocessing package doesn't flush stderr on child exception

2015-08-27 Thread Memeplex
Memeplex added the comment: http://bugs.python.org/issue24948 I posted a tentative solution there. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13812

[issue5430] Must not replace LF or CR by CRLF in literals

2009-03-05 Thread Memeplex
New submission from Memeplex carlosjosep...@gmail.com: For example, after that normalization, quoted printable encoded headers (as described at rfc 2047) longer than 76 characters are splitted in two different ill-formed headers because the soft LF line break becomes a hard CRLF one

[issue5430] imaplib: must not replace LF or CR by CRLF in literals

2009-03-05 Thread Memeplex
Changes by Memeplex carlosjosep...@gmail.com: -- title: Must not replace LF or CR by CRLF in literals - imaplib: must not replace LF or CR by CRLF in literals ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5430