[issue29514] Add a test case that prevents magic number changes in minor releases

2017-02-13 Thread Petr Viktorin
Petr Viktorin added the comment: > perhaps Petr's patch to accept both magic numbers should be submitted > upstream so it's the default in 3.5.4+? I don't think it can be submitted in the current state; it's a one-time hack intended to be removed and forgotten at the end of 3.5's lifeti

[issue29514] Add a test case that prevents magic number changes in minor releases

2017-02-10 Thread Petr Viktorin
Petr Viktorin added the comment: According to issue27286, Ubuntu 16.04LTS has the fix and uses the new magic number. (And this is one reason undoing the change in CPython is out of the question.) The patch Nick mentioned is brewing at https://github.com/encukou/cpython/commit/magic-number

[issue29514] Add a test case that prevents magic number changes in minor releases

2017-02-10 Thread Petr Viktorin
Petr Viktorin added the comment: > How would you propose to fix broken bytecodes in a bugfix be fixed if you > can't bump the magic number? That would depend on the situation. I can imagine that if the bug is severe enough, the number could be bumped, after careful disc

[issue29514] Add a test case that prevents magic number changes in minor releases

2017-02-09 Thread Petr Viktorin
Petr Viktorin added the comment: For the record, the magic number was changed in issue27286 -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue1353344] python.desktop

2017-02-08 Thread Petr Viktorin
Changes by Petr Viktorin <encu...@gmail.com>: -- nosy: +ncoghlan ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue1353344> ___ _

[issue29179] Py_UNUSED is not documented

2017-01-06 Thread Petr Viktorin
New submission from Petr Viktorin: The Py_UNUSED macro, which was added in Python 3.4, is not documented. Is this an omission, or is it undocumented on purpose? I can prepare a patch if it's the former. The macro was added in: http://bugs.python.org/issue19976 and referenced in: http

[issue27961] remove support for platforms without "long long"

2017-01-03 Thread Petr Viktorin
Petr Viktorin added the comment: The backwards compatibility is not as strong as it could be: previously, HAVE_LONG_LONG was defined to 1; now it's defined but empty. At least that's the case on Fedora. Found in the Python plugin for GCC: https://bugzilla.redhat.com/show_bug.cgi?id=1409009

[issue27910] Doc/library/traceback.rst — references to tuples should be replaced with new FrameSummary object

2016-10-20 Thread Petr Viktorin
Petr Viktorin added the comment: ping Anything I can do to move this forward? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue28403] Porting guide: disabling & warning on implicit unicode conversions

2016-10-10 Thread Petr Viktorin
Petr Viktorin added the comment: In portingguide [0] I could only recommend sitecustomize with a (possibly third-party) codec that emits warnings; not 'undefined'. The things that aren't ported yet are generally either Non-Python applications with Python bindings or plugins (Gimp, Samba

[issue27990] Provide a way to enable getrandom on Linux even when build system runs an older kernel

2016-09-21 Thread Petr Viktorin
Petr Viktorin added the comment: (Please ignore that comment – I was on vacation and, when clearing my backlog, got to this issue before the Fedora discussions.) -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue27990] Provide a way to enable getrandom on Linux even when build system runs an older kernel

2016-09-21 Thread Petr Viktorin
Petr Viktorin added the comment: Indeed, I'd close WONTFIX. IMO, applications that: - run at early boot, and - get built with an older kernel than they run on fall squarely into the enterprise distro turf, and CPython code shouldn't include hacks needed to make this work. That's not to say I'm

[issue27910] Doc/library/traceback.rst — references to tuples should be replaced with new FrameSummary object

2016-09-09 Thread Petr Viktorin
Petr Viktorin added the comment: This was a deliberate change in 3.5. Issue: https://bugs.python.org/issue17911 News entry: https://docs.python.org/3/whatsnew/3.5.html#traceback Why do you think it is a regression? Who would be the person that can decide if it is a doc bug or regression

[issue27930] logging's QueueListener drops log messages

2016-09-01 Thread Petr Viktorin
New submission from Petr Viktorin: There are two "barrier" like abstractions on Lib/logging/handlers.py in the _monitor method. First _monitor has two loops, what is already kind of a hint something is not right. Second, it has two ways to exit the loop, that also exit the

[issue27782] Multi-phase extension module initialization, inconsistent exceptions and conflicts between code and PEP

2016-08-17 Thread Petr Viktorin
Petr Viktorin added the comment: Hi! I'm on a tight schedule this week, so I'm not looking into this in detail. But please let me know if you need any help and I'll raise the priority. -- ___ Python tracker <rep...@bugs.python.org>

[issue27568] "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts

2016-07-29 Thread Petr Viktorin
Petr Viktorin added the comment: The conversation seems to have stalled. Rémi, are you still working on the patch? Should someone take over? -- nosy: +encukou ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue27332] Clinic: first parameter for module-level functions should be PyObject*, not PyModuleDef*

2016-07-07 Thread Petr Viktorin
Petr Viktorin added the comment: Hello, Is there anything I can do to help get this issue resolved? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue27201] expose the ABI name as a config variable

2016-06-21 Thread Petr Viktorin
Changes by Petr Viktorin <encu...@gmail.com>: -- nosy: +encukou ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27201> ___ __

[issue27332] Clinic: first parameter for module-level functions should be PyObject*, not PyModuleDef*

2016-06-16 Thread Petr Viktorin
New submission from Petr Viktorin: Currently, Argument Clinic generates "PyModuleDef * module" for the first argument of module-level functions. But, the functions are passed the actual module object, not the ModuleDef. The correct type to use is PyObject*, which is used f

[issue27183] Clarify that Py_VISIT(NULL) does nothing

2016-06-02 Thread Petr Viktorin
New submission from Petr Viktorin: The Py_VISIT macro (in Include/objimpl.h) does nothing if passed NULL (and did this since its introduction). It would be nice to have this formally documented. -- assignee: docs@python components: Documentation files: 0001-Doc-c-api-Clarify

[issue26673] Tkinter error when opening IDLE configuration menu

2016-04-13 Thread Petr Viktorin
Petr Viktorin added the comment: Indeed, the size is 0 there: {'family': 'DejaVu Sans Mono', 'size': 0, 'slant': 'roman', 'weight': 'normal', 'overstrike': 0, 'underline': 0} -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.p

[issue26673] Tkinter error when opening IDLE configuration menu

2016-04-12 Thread Petr Viktorin
Petr Viktorin added the comment: buggy: configuredFont: ('DejaVu Sans Mono', 0, 'normal') fontSize: 0 good: configuredFont: ('courier', 10, 'normal') fontSize: 10 -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.p

[issue26673] Tkinter error when opening IDLE configuration menu

2016-04-11 Thread Petr Viktorin
Petr Viktorin added the comment: I can reproduce this with Python 2.7.11 and somewhat recent build from hg default (3.6.0a0) on Fedora 23. Putting these lines in my personal config-main.cfg solves this:: [EditorWindow] font= courier idlelib/config-main.def has a different default

[issue26502] traceback.extract_tb breaks compatibility by returning FrameSummary

2016-03-07 Thread Petr Viktorin
New submission from Petr Viktorin: According to the docs [0], traceback.extract_tb should return 4-tuples (filename, line number, function name, text). [0] https://docs.python.org/3/library/traceback.html#traceback.extract_tb Instead, since Python 3.5, it returns FrameSummary objects, which

[issue26331] Tokenizer: allow underscores for grouping in numeric literals

2016-02-10 Thread Petr Viktorin
Petr Viktorin added the comment: Regarding the patch: if trailing underscores are not allowed, `0 if 1_else 1` should be illegal. -- nosy: +encukou ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue26287] Core dump in f-string with lambda and format specification

2016-02-04 Thread Petr Viktorin
New submission from Petr Viktorin: Evaluating the expression f"{(lambda: 0):x}" crashes Python. $ ./python Python 3.6.0a0 (default, Feb 5 2016, 02:14:48) [GCC 5.3.1 20151207 (Red Hat 5.3.1-2)] on linux Type "help", "copyright", "credits" or "licens

[issue26208] decimal C module's exceptions don't match the Python version

2016-01-26 Thread Petr Viktorin
New submission from Petr Viktorin: Exceptions from the decimal module are quite unfriendly: >>> Decimal(42) / Decimal(0) ... decimal.DivisionByZero: [] >>> huge = Decimal('9' * 99) >>> huge.quantize(Decimal('0.1')) ... decimal.Inva

[issue25079] Tokenize generates NL instead of NEWLINE for comments

2015-09-20 Thread Petr Viktorin
Petr Viktorin added the comment: As it says in the docs, a "logical line that contains only spaces, tabs, formfeeds and possibly a comment, is ignored." If you write: if a=b: statement # Comment another statement both statements belong to the "if" block. In your

[issue24937] Multiple problems in getters & setters in capsulethunk.h

2015-09-08 Thread Petr Viktorin
Petr Viktorin added the comment: This patch removes capsulethunk.h from the docs, and directs the kind reader to the py3c project, which carries a fixed and tested version of it, along with the docs. Larry, would you be OK with releasing capsulethunk.h under the MIT license? The PSF license

[issue13053] Add Capsule migration documentation to "cporting"

2015-09-08 Thread Petr Viktorin
Petr Viktorin added the comment: As capsulethunk.h is only needed for Python 2.6 and below, which are no longer maintained, in issue24937 we are discussing moving the header to an external project. -- nosy: +encukou ___ Python tracker <

[issue24937] Multiple problems in getters & setters in capsulethunk.h

2015-09-08 Thread Petr Viktorin
Petr Viktorin added the comment: Thank you for the license. I mentioned my project mainly as a place where this code can be *tested*. I have no problem with keeping capsulethunk.h in the Python docs, and synchronizing the two projects if changes are made on either side. In other words, feel

[issue24951] Idle test_configdialog fails on Fedora 23, 3.6

2015-09-07 Thread Petr Viktorin
Petr Viktorin added the comment: Sorry for the delay; I lost the mail notification. I don't have a config-main.cfg file. The last output from the test, with the print added: test_dialog (idlelib.idle_test.test_configdialog.ConfigDialogTest) ... ('.139655680391704', 'configure', '-borderwidth

[issue24748] Change of behavior for importlib between 3.4 and 3.5 with DLL loading

2015-09-04 Thread Petr Viktorin
Petr Viktorin added the comment: So, if I understand correctly, the problem is that the new imp.load_dynamic in 3.5.0b checks sys.modules, so if a module of the same name was loaded previously, it's only reloaded, skipping the create_module step. This patch bypasses that check, so a new

[issue24748] Change of behavior for importlib between 3.4 and 3.5 with DLL loading

2015-09-03 Thread Petr Viktorin
Petr Viktorin added the comment: Indeed. I don't have access to a Windows machine, but I will try reproducing the problem on another system. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue24951] Idle test_configdialog fails on Fedora 23, 3.6

2015-08-28 Thread Petr Viktorin
Petr Viktorin added the comment: I'd be happy to do any further testing (modulo a vacation until this Tuesday), but unfortunately I don't have time to dive into tkinter myself and look for the cause. IDLE starts normally on this box. Also note: Fedora 23 is currently in alpha (though Python

[issue24937] Multiple problems in getters setters in capsulethunk.h

2015-08-25 Thread Petr Viktorin
Petr Viktorin added the comment: Note: I'm including a tested (+fixed, now) copy of capsulethunk.h in my set of Python3 C extension porting helpers, http://py3c.readthedocs.org Unfortunately the tests can't be added to CPython, because they need to run on Python 2.6 to be useful. That makes

[issue24937] Multiple problems in getters setters in capsulethunk.h

2015-08-25 Thread Petr Viktorin
New submission from Petr Viktorin: In https://docs.python.org/3/howto/cporting.html#cobject-replaced-with-capsule (added in issue13053): 1) __PyCapsule_GetField is defined as:: #define __PyCapsule_GetField(capsule, field, default_value) ... but called as:: __PyCapsule_GetField

[issue24878] Add docstrings to selected named tuples

2015-08-18 Thread Petr Viktorin
Petr Viktorin added the comment: I see some typos in aifc.py: +_aifc_params.sampwidth.__doc__ = 'Ample width in bytes' +_aifc_params.compname.__doc__ = (A human-readable version ofcompression type Should that be Sample width and of compression? -- nosy: +encukou

[issue24769] Interpreter doesn't start when dynamic loading is disabled

2015-08-10 Thread Petr Viktorin
Petr Viktorin added the comment: Right. I think a common helper is cleaner than calling a clinic-generated wrapper. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24769

[issue24769] Interpreter doesn't start when dynamic loading is disabled

2015-08-10 Thread Petr Viktorin
Petr Viktorin added the comment: Apologies for the delay; I was on vacation. This was indeed a mistake in PEP 489 implementation. I agree with Nick on the solution. Here is a patch that adds exec_builtin, with implementation shared with exec_dynamic. -- keywords: +patch Added file

[issue24748] Change of behavior for importlib between 3.4 and 3.5 with DLL loading

2015-07-29 Thread Petr Viktorin
Petr Viktorin added the comment: Eric or me. I'm not sure I understand the description clearly. Etienne, would it be possible to write a smaller reproducer, that wouldn't be tied to Windows? Or is this Windows-only behavior? -- ___ Python tracker

[issue24747] ctypes silently truncates ints larger than C int

2015-07-29 Thread Petr Viktorin
New submission from Petr Viktorin: A Python int larger than a C int but smaller than a C long is silently truncated to int when passed to a ctypes function without C type information attached. Ints longer than C long fail with an OverflowError; I believe the same should happen for numbers

[issue24747] ctypes silently truncates ints larger than C int

2015-07-29 Thread Petr Viktorin
Petr Viktorin added the comment: Originally found here: https://bugzilla.redhat.com/show_bug.cgi?id=1244261 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24747

[issue24713] Import docs reference the deprecated imp.reload

2015-07-25 Thread Petr Viktorin
New submission from Petr Viktorin: In 3.4, `imp.reload` was deprecated in favor of `importlib.reload`. https://docs.python.org/3/library/imp.html -- assignee: docs@python components: Documentation files: docs.patch keywords: patch messages: 247319 nosy: docs@python, encukou

[issue19713] Deprecate various things in importlib thanks to PEP 451

2015-07-11 Thread Petr Viktorin
Changes by Petr Viktorin encu...@gmail.com: -- nosy: +encukou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19713 ___ ___ Python-bugs-list mailing

[issue24596] Script globals in a GC cycle not finalized when exiting with SystemExit

2015-07-09 Thread Petr Viktorin
New submission from Petr Viktorin: When this program is invoked as a script (`python reproducer.py`), the __del__ is never called: --- class ClassWithDel: def __del__(self): print('__del__ called') a = ClassWithDel() a.link = a raise SystemExit(0) --- Raising a different

[issue24458] Documentation for PEP 489

2015-07-03 Thread Petr Viktorin
Petr Viktorin added the comment: Verifying modules to work ith subinterpreters is tricky. What level of assurance do you want? Subinterpreters themselves require that you embed Python, which doesn't lend itself to an easy example. I hope 2.6 makes the situation better. Example code

[issue24458] Documentation for PEP 489

2015-07-03 Thread Petr Viktorin
Petr Viktorin added the comment: Thanks for the review. I've added the explanation you suggested, and I've made the names monospace (or linked them, where it seemed appropriate). I've also marked *NULL*s like in the rest of the doc. -- Added file: http://bugs.python.org/file39851

[issue24458] Documentation for PEP 489

2015-07-03 Thread Petr Viktorin
Petr Viktorin added the comment: Yes! Aside from the callback problem, which is left for another PEP, but limits PEP 489 usefulness in the real world :( It turns out that one is quite a rabbit hole. I'll post my findings on that soon-ish

[issue23642] Interaction of ModuleSpec and C Extension Modules

2015-06-16 Thread Petr Viktorin
Petr Viktorin added the comment: ping; this issue can be closed. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23642 ___ ___ Python-bugs-list

[issue24458] Documentation for PEP 489

2015-06-16 Thread Petr Viktorin
New submission from Petr Viktorin: Hello, Here is a patch documenting PEP 489. I don't feel comfortable rewriting the tutorial [0] yet: before the issue with callbacks/module state [1] is solved, which is 3.6 material, multi-phase init is not suitable for all modules. So everything in PEP 489

[issue23642] Interaction of ModuleSpec and C Extension Modules

2015-06-05 Thread Petr Viktorin
Petr Viktorin added the comment: Since PEP 489 (Python 3.5.0b1), loaders now support create_module/exec_module. For modules which don't use the PEP's new multi-phase init mechanism (which is most of them, currently), load_module() does all the work and exec_module is a no-op. So, this issue

[issue24373] Use traverse finalize in xxlimited and in PEP 489 tests

2015-06-04 Thread Petr Viktorin
Petr Viktorin added the comment: tp_traverse is completely orthogonal to tp_dealloc, it's needed to detect (and then break) reference cycles like: obj = xxlimited.Xxo() obj.foo = obj As for tp_finalize: yes, mentioning it in tp_dealloc docs would be good, but I'll need a bit more

[issue24268] PEP 489 -- Multi-phase extension module initialization

2015-06-03 Thread Petr Viktorin
Petr Viktorin added the comment: I've posted a patch that fixes the remaining refleak in issue24373. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24268

[issue24373] Use traverse finalize in xxlimited and in PEP 489 tests

2015-06-03 Thread Petr Viktorin
New submission from Petr Viktorin: The example object in the xxlimited module can be part of a reference loop (it can contain itself), so it needs GC and tp_traverse. The tp_dealloc hook was incorrect, and a correct version would be difficult to generalize for something more complicated than

[issue24365] Conditionalize 3.5 additions to the stable ABI

2015-06-02 Thread Petr Viktorin
Petr Viktorin added the comment: I meant stable ABI, of course -- title: Conditionalize 3.5 additions to the stable API - Conditionalize 3.5 additions to the stable ABI ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24365

[issue24365] Conditionalize 3.5 additions to the stable API

2015-06-02 Thread Petr Viktorin
New submission from Petr Viktorin: I have sent patches to 3.5 that add new stable API, and later I learned [0] that additions should be conditional on the value of Py_LIMITED_API. This patch adds #ifdef blocks for what was added in issues #24268 and #24345. [0] https://mail.python.org

[issue24345] Py_tp_finalize is missing

2015-06-01 Thread Petr Viktorin
New submission from Petr Viktorin: PEP 442 added the tp_finalize member for objects, but there's no corresponding Py_tp_finalize slot. This means that types defined using PyType_FromSpec (and in particular, extensions using the stable ABI) can't take advantage of the new GC finalization

[issue24268] PEP 489 -- Multi-phase extension module initialization

2015-05-29 Thread Petr Viktorin
Petr Viktorin added the comment: Ah, indeed. I need to create a new bytes object here after all. Here is a fix, with a test. Thank you Stefan! -- Added file: http://bugs.python.org/file39546/fix-short-names.patch ___ Python tracker rep

[issue24268] PEP 489 -- Multi-phase extension module initialization

2015-05-29 Thread Petr Viktorin
Petr Viktorin added the comment: I've opened issue24328 for that regression. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24268 ___ ___ Python

[issue24328] Extension modules with single-letter names can't be loaded

2015-05-29 Thread Petr Viktorin
New submission from Petr Viktorin: A regression in the PEP 489 implementation prevents loading extension modules with single-character names (because length-1 bytestrings are interned). Here is a fix. It would be great to have it in 3.5.0b2. -- files: fix-short-names.patch keywords

[issue24268] PEP 489 -- Multi-phase extension module initialization

2015-05-29 Thread Petr Viktorin
Petr Viktorin added the comment: And, the remaining refleak is a known issue from 2012: PyType_FromSpec-created types with custom tp_dealloc leak references when instantiated. See issue 16690 There's more discussion is in issue 15653 Martin v. Löwis notes: So I'd propose that it is actually

[issue24298] inspect.signature includes bound argument for wrappers around bound methods

2015-05-27 Thread Petr Viktorin
Petr Viktorin added the comment: Reported by David Gibson here: https://bugzilla.redhat.com/show_bug.cgi?id=1201990 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24298

[issue24298] inspect.signature includes bound argument for wrappers around bound methods

2015-05-27 Thread Petr Viktorin
New submission from Petr Viktorin: When obtaining the signature of a bound method, inspect.signature, by default, omits the self argument to the method, since it is already specified in the bound method. However, if you create a wrapper around a bound method with functools.update_wrapper

[issue24268] PEP 489 -- Multi-phase extension module initialization

2015-05-25 Thread Petr Viktorin
Petr Viktorin added the comment: Yes, you did find an error. Thanks for reporting it! Here is a fix with a test case. -- Added file: http://bugs.python.org/file39493/fix-pep489-submodule.patch ___ Python tracker rep...@bugs.python.org http

[issue24285] regression for importing extensions in packages

2015-05-25 Thread Petr Viktorin
Petr Viktorin added the comment: issue 24268 has a patch with a test case. -- nosy: +encukou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24285

[issue24268] PEP 489 -- Multi-phase extension module initialization

2015-05-23 Thread Petr Viktorin
Petr Viktorin added the comment: Thank you, Steve. A similar problem is on other platforms as well. This patch should fix it; could someone look at it? -- Added file: http://bugs.python.org/file39477/fix-dynload-init-name.patch ___ Python tracker

[issue24268] PEP 489 -- Multi-phase extension module initialization

2015-05-23 Thread Petr Viktorin
Petr Viktorin added the comment: Steve, could you please merge it? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24268 ___ ___ Python-bugs-list

[issue24268] PEP 489 -- Multi-phase extension module initialization

2015-05-23 Thread Petr Viktorin
Petr Viktorin added the comment: And here are all changes in a single patch. -- keywords: +patch Added file: http://bugs.python.org/file39471/pep0489.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24268

[issue24268] PEP 489 -- Multi-phase extension module initialization

2015-05-23 Thread Petr Viktorin
New submission from Petr Viktorin: Here is the implementation for the recently accepted PEP 489. Tested on Linux. -- files: pep0489.patches messages: 243893 nosy: encukou, eric.snow, ncoghlan priority: normal severity: normal status: open title: PEP 489 -- Multi-phase extension module

[issue24268] PEP 489 -- Multi-phase extension module initialization

2015-05-23 Thread Petr Viktorin
Petr Viktorin added the comment: FWIW, the remaining refleak occurs when unloading an extension module object. This is something that wasn't possible before PEP 489 -- extension modules were never deleted. -- ___ Python tracker rep

[issue24268] PEP 489 -- Multi-phase extension module initialization

2015-05-23 Thread Petr Viktorin
Petr Viktorin added the comment: Fix some refleaks - one in PyModule_FromDefAndSpec2 - this is my fault - one in PyType_FromSpecWithBases - I guess this is the first time PEP-384 built-in types are GC'd - one in the new PEP 489 tests There's still one more in the new testing module

[issue24268] PEP 489 -- Multi-phase extension module initialization

2015-05-23 Thread Petr Viktorin
Petr Viktorin added the comment: The array module is good if you *really* drop references: $ ./python -X showrefcount Python 3.5.0a4+ (default, May 23 2015, 16:44:38) [GCC 4.9.2 20150212 (Red Hat 4.9.2-6)] on linux Type help, copyright, credits or license for more information. import sys, gc

[issue23699] Add a macro to ease writing rich comparisons

2015-05-22 Thread Petr Viktorin
Petr Viktorin added the comment: Just a reminder: if you want this to be in Python 3.5, please review the patch -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23699

[issue23699] Add a macro to ease writing rich comparisons

2015-05-21 Thread Petr Viktorin
Petr Viktorin added the comment: Here is a version with PyErr_BadArgument. -- Added file: http://bugs.python.org/file39455/richcompare-macro-badargument.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23699

[issue23699] Add a macro to ease writing rich comparisons

2015-05-20 Thread Petr Viktorin
Petr Viktorin added the comment: Well, in my opinion NotImplemented is a good value for unknown operation, but I'll be happy to change to PyErr_BadArgument(); return NULL; if there's support for that. -- ___ Python tracker rep...@bugs.python.org

[issue23699] Add a macro to ease writing rich comparisons

2015-05-18 Thread Petr Viktorin
Petr Viktorin added the comment: Conceptually there's a distinction between the two cases, but you can implement one in terms of the other, so I don't think it's worth adding two functions/macros here. So let's pick the better API. Py_cmp_to_bool is better if you already have a cmp-style

[issue23699] Add a macro to ease writing rich comparisons

2015-05-15 Thread Petr Viktorin
Petr Viktorin added the comment: What can I, not a core developer, do to resolve this disagreement? Should I submit a PEP? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23699

[issue23699] Add a macro to ease writing rich comparisons

2015-05-14 Thread Petr Viktorin
Petr Viktorin added the comment: Well, as a newcomer, I think the macro makes it easier to both grok what the code does, and is about equally difficult when it comes to checking correctness of the code. But I understand that's a subjective. Marc-Andre, Barry, you expressed interest

[issue1322] Deprecate platform.dist() and platform.linux_distribution() functions

2015-05-13 Thread Petr Viktorin
Petr Viktorin added the comment: Issues #17762 and #9514 had patches to improve these functions. Time to close them? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1322

[issue17762] platform.linux_distribution() should honor /etc/os-release

2015-05-13 Thread Petr Viktorin
Petr Viktorin added the comment: The functions have been deprecated in #1322, is it time to close this? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17762

[issue23699] Add a macro to ease writing rich comparisons

2015-05-13 Thread Petr Viktorin
Petr Viktorin added the comment: From the discussion on the list: - It needs to be a macro, not function, to support various types (unsigned long long, float; possibly C++ stuff with overriden operators) - Another suggestion to change the order of arguments; I still think being the same

[issue23699] Add a macro to ease writing rich comparisons

2015-05-13 Thread Petr Viktorin
Petr Viktorin added the comment: Is it really not better to give the operation a name, rather than repeating the same ten lines every time? (Well, not the same -- all the modules code it a bit differently, but with the same meaning.) I might be true that the types in Python itself are done

[issue1322] Deprecate platform.dist() and platform.linux_distribution() functions

2015-05-12 Thread Petr Viktorin
Changes by Petr Viktorin encu...@gmail.com: -- nosy: +encukou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1322 ___ ___ Python-bugs-list mailing

[issue17762] platform.linux_distribution() should honor /etc/os-release

2015-05-12 Thread Petr Viktorin
Changes by Petr Viktorin encu...@gmail.com: -- nosy: +encukou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17762 ___ ___ Python-bugs-list mailing

[issue24082] Obsolete note in argument parsing (c-api/arg.rst)

2015-05-03 Thread Petr Viktorin
Petr Viktorin added the comment: The note is *correct* concerning the length, but I don't think it's relevant: in a NUL-terminated string without embedded NULs, the length is unambiguous. The other issues are about u itself, not the note. (I have nothing against the it is recommended to use u

[issue24081] Obsolete caveat in reload() docs

2015-05-02 Thread Petr Viktorin
Petr Viktorin added the comment: Not true (on 3.3 2.7). import sys import x Traceback (most recent call last): File stdin, line 1, in module File /tmp/x.py, line 1, in module import y File /tmp/y.py, line 1, in module 1/0 ZeroDivisionError: division by zero sys.modules['x

[issue24082] Obsolete note in argument parsing (c-api/arg.rst)

2015-04-30 Thread Petr Viktorin
New submission from Petr Viktorin: A note in the docs for the u format unit saus NULs are not allowed, but the previous sentence says they aren't accepted. -- assignee: docs@python components: Documentation files: 0002-Remove-obsolete-note-in-argument-parsing-docs.patch keywords: patch

[issue24081] Obsolete caveat in reload() docs

2015-04-30 Thread Petr Viktorin
New submission from Petr Viktorin: imp.reload() and importlib.reload() docs state:: If a module is syntactically correct but its initialization fails, the first :keyword:`import` statement for it does not bind its name locally, but does store a (partially initialized) module object

[issue24056] Expose closure generator status in function repr()

2015-04-25 Thread Petr Viktorin
Changes by Petr Viktorin encu...@gmail.com: -- nosy: +encukou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24056 ___ ___ Python-bugs-list mailing

[issue23699] Add a macro to ease writing rich comparisons

2015-04-23 Thread Petr Viktorin
Petr Viktorin added the comment: ping Anything I can do to help move this forward? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23699

[issue22198] Odd floor-division corner case

2015-04-15 Thread Petr Viktorin
Petr Viktorin added the comment: ping? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22198 ___ ___ Python-bugs-list mailing list Unsubscribe

[issue23699] Add a macro to ease writing rich comparisons

2015-03-23 Thread Petr Viktorin
Petr Viktorin added the comment: Changed the macro to Py_RETURN_RICHCOMPARE. This is not an expression, allowing the use of a switch statement. On the other hand, it's even larger macro than before now. From the discussion it seems that doing this correctly is tricky to do this correctly

[issue23699] Add a macro to ease writing rich comparisons

2015-03-20 Thread Petr Viktorin
Petr Viktorin added the comment: Attaching another patch: - Leave _decimal alone per maintainer's wishes - Fixes issues pointed out in the review - Use Py_RICHCOMPARE also in _tkinter - More improvements in the other affected modules -- Added file: http://bugs.python.org/file38605

[issue23699] Add a macro to ease writing rich comparisons

2015-03-20 Thread Petr Viktorin
Petr Viktorin added the comment: Making it a function might help with the following issues: - series of comparisons and PyBool_FromLong is less efficient than switch and Py_RETURN_*. But it would add a function call. - it might be too complex for a macro Do you think that would help

[issue23699] Add a macro to ease writing rich comparisons

2015-03-20 Thread Petr Viktorin
Petr Viktorin added the comment: Serhiy: Thanks for looking at this! I think it should fall in the same category as Py_RETURN_TRUE or Py_RETURN_NONE. Sure, it's easy to reimplement, but a lot of extensions need it; why should everyone need to write the same code in a dozen different ways? I

[issue23699] Add a macro to ease writing rich comparisons

2015-03-18 Thread Petr Viktorin
Petr Viktorin added the comment: Here is a patch that uses the macro in all the places it can help. -- Added file: http://bugs.python.org/file38542/0002-Use-Py_RICHCOMPARE-in-rich-comparisons.patch ___ Python tracker rep...@bugs.python.org http

[issue23699] Add a macro to ease writing rich comparisons

2015-03-18 Thread Petr Viktorin
New submission from Petr Viktorin: Rich comparison functions of many builtin types include a block of boilerplate which can be consolidated in a macro. The macro can be useful for third-party extensions as well as CPython itself. See this e-mail for a longer write-up: https://mail.python.org

[issue22198] Odd floor-division corner case

2015-01-15 Thread Petr Viktorin
Petr Viktorin added the comment: ping, is there anything I can do to help push the patch forward? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22198

[issue22198] Odd floor-division corner case

2014-11-10 Thread Petr Viktorin
Petr Viktorin added the comment: ping, could someone please review the patch? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22198

[issue22198] Odd floor-division corner case

2014-10-09 Thread Petr Viktorin
Petr Viktorin added the comment: Apologies for the delay; I missed/did not get a notification. Alexander, I don't disagree, but I'd like my first patch to Python to not be a refactoring. As I said, I'd like to keep this patch focused. After that I'd like to provide tests the rest

<    4   5   6   7   8   9   10   >