[issue27217] IDLE 3.5.1 not using Tk 8.6

2016-06-04 Thread Emanuel Barry
Changes by Emanuel Barry : -- components: +IDLE, Macintosh nosy: +kbk, ned.deily, roger.serwy, ronaldoussoren, terry.reedy stage: -> test needed type: resource usage -> behavior versions: +Python 3.5 ___ Python tracker <http://bugs.p

[issue27220] Add a pure Python version of 'collections.defaultdict'

2016-06-04 Thread Emanuel Barry
New submission from Emanuel Barry: Attached patch adds a pure Python version of `collections.defaultdict`. This is yet another step in providing better support for alternate implementations, which may or may not have `_collections`. I also went ahead and fixed __all__ so that `from

[issue26809] Add __all__ list to the string module

2016-06-04 Thread Emanuel Barry
Changes by Emanuel Barry : -- title: `string` exposes ChainMap from `collections` -> Add __all__ list to the string module ___ Python tracker <http://bugs.python.org/issu

[issue21130] equivalent functools.partial instances should compare equal

2016-06-04 Thread Emanuel Barry
Emanuel Barry added the comment: Git diffs work, but this one doesn't apply cleanly. I manually fixed it and re-generated the patch. Rietveld should pick it up now. Otherwise, what Jelle said. I'm not sure if the macro has the best name though - I'd probably name it `PyPartial_

[issue21130] equivalent functools.partial instances should compare equal

2016-06-04 Thread Emanuel Barry
Emanuel Barry added the comment: New patch with Jelle's suggestions. I completely removed the macros since we need to (potentially) call Python code with PyObject_IsInstance, and need to check for return code. I also reverted some of the unrelated changes. -- Added file:

[issue27137] Python implementation of `functools.partial` is not a class

2016-06-04 Thread Emanuel Barry
Emanuel Barry added the comment: New patch, now almost all the tests that are used for the C version are also used for the Python version (the only exception is the one checking that trying to change/delete attributes would raise an error). Some tests needed a bit of tweaking to work with the

[issue21130] equivalent functools.partial instances should compare equal

2016-06-05 Thread Emanuel Barry
Emanuel Barry added the comment: Shakur - Feel free to take over and work on it. Serhiy - I don't think that partial(func) == func should be, in the same sense that (0, 1, 2), [0, 1, 2] and range(3) aren't equal even though they fundamentally represent the

[issue27242] Clarify the use cases of NotImplemented in the docs

2016-06-06 Thread Emanuel Barry
New submission from Emanuel Barry: The NotImplemented docs aren't explicit enough when it comes to where it can/should be used. Patch attached. -- assignee: docs@python components: Documentation files: NotImplemented_wording_1.patch keywords: patch messages: 267543 nosy: docs@p

[issue27242] Make the docs for NotImplemented & NotImplementedError unambigous

2016-06-06 Thread Emanuel Barry
Emanuel Barry added the comment: Added further notes to `NotImplemented` and `NotImplementedError` to clearly state the differences between the two. I also added some more details to `TypeError` - I'm amazed at how little was described for such a common exception! Maybe I explained a bi

[issue27246] Keyboard Shortcuts Crash Idle

2016-06-06 Thread Emanuel Barry
Emanuel Barry added the comment: Your report was already addressed in #27192, and the solution to your problem was given by Ned Deily. If you are still experiencing crashes with the official python.org version, please specify so. In the meantime, I'm closing this off as dupl

[issue27242] Make the docs for NotImplemented & NotImplementedError unambigous

2016-06-06 Thread Emanuel Barry
Emanuel Barry added the comment: New patch with small tweaks. Thanks Jelle for the comments! -- Added file: http://bugs.python.org/file43273/NotImplemented_exceptions_wording_3.patch ___ Python tracker <http://bugs.python.org/issue27

[issue27242] Make the docs for NotImplemented & NotImplementedError unambigous

2016-06-07 Thread Emanuel Barry
Emanuel Barry added the comment: More tweaks after Ethan's comments. This is starting to get way outside of the realm of NotImplemented, but it still makes for a good reference to point confused users at. -- Added file: http://bugs.python.org/file

[issue27242] Make the docs for NotImplemented & NotImplementedError unambigous

2016-06-08 Thread Emanuel Barry
Emanuel Barry added the comment: Martin: yes, I plan to install Sphinx soon enough, so that I can build the docs. As for the notes part, I indented it exactly like it was indented for other existing notes boxes in the same file. I'll change that if needed t

[issue27356] csv

2016-06-20 Thread Emanuel Barry
Emanuel Barry added the comment: (Berker beat me to it, but posting anyway since it is more detailed) Backslashes are escape characters, and "\b" is treated as "\x08". Invalid combinations (e.g. "\A", "\D"...) automatically escape the backslash, but yo

[issue27358] BUILD_MAP_UNPACK_WITH_CALL is slow

2016-06-21 Thread Emanuel Barry
Emanuel Barry added the comment: `dict` subclasses can be hashable - it's a very bad idea, but not guarded against. If you were to do this, I'd suggest going the exception way, à la StopIteration. I wonder how feasible it would be for e.g. dict.__setitem__ to check if a key alre

[issue27362] json.dumps to check for obj.__json__ before raising TypeError

2016-06-21 Thread Emanuel Barry
Emanuel Barry added the comment: I'm not too familiar with the json package, but what should __json__ return when called? -- nosy: +ebarry stage: -> test needed versions: +Python 3.6 ___ Python tracker <http://bugs.python.org

[issue27362] json.dumps to check for obj.__json__ before raising TypeError

2016-06-21 Thread Emanuel Barry
Emanuel Barry added the comment: So __json__ returns a string meant to be serializable. I'm not too keen on using a dunder name (although my word doesn't weigh anything ;) and I'd personally prefer something like as_json_string(). I think the idea in general is good, though. Mi

[issue27364] Deprecate invalid unicode escape sequences

2016-06-21 Thread Emanuel Barry
New submission from Emanuel Barry: Attached patch deprecates invalid escape sequences in unicode strings. The point of this is to prevent issues such as #27356 (and possibly other similar ones) in the future. Without the patch: >>> "hello \world" 'hello \\world'

[issue27364] Deprecate invalid unicode escape sequences

2016-06-23 Thread Emanuel Barry
Emanuel Barry added the comment: Now I have! I found nothing on Python-Dev, but apparently it's been discussed on Python-ideas before: https://mail.python.org/pipermail/python-ideas/2015-August/035031.html Guido hasn't participated in that discussion, and most of it was "

[issue27364] Deprecate invalid unicode escape sequences

2016-06-23 Thread Emanuel Barry
Emanuel Barry added the comment: Yes, it's in use in an awful lot of places (see my patch). The proper fix is to use raw strings, or, if you need actual escapes in the same string, manually escape them. However, as you'll see by looking at the patch, the vast majority of cases ar

[issue27364] Deprecate invalid unicode escape sequences

2016-06-23 Thread Emanuel Barry
Emanuel Barry added the comment: Thanks, didn't find that one. Apparently Guido's stance is "Make this a silent warning, then we can discuss about preventing it later", which happens to be what I'm doing here. --

[issue27364] Deprecate invalid unicode escape sequences

2016-06-23 Thread Emanuel Barry
Emanuel Barry added the comment: I found the cause of the failed assertion, an invalid escape sequence slipped through in a file. Patch attached (also with Serhiy's comments). It worries me a little though that pure Python code can cause a hard crash. Ok, it worries me a lot. Please

[issue27382] calendar module .isleap() probleam

2016-06-24 Thread Emanuel Barry
Emanuel Barry added the comment: You're overriding the 'calendar' variable, holding the module, by the result of your 'calender.month' call, which happens to be a str. Use a different variable name (e.g. 'result') and the error will disappear. Unrelated

[issue27364] Deprecate invalid unicode escape sequences

2016-06-26 Thread Emanuel Barry
Emanuel Barry added the comment: I originally considered making two different patches, so there you go. deprecate_invalid_escapes_only_1.patch has the deprecation plus a test, and invalid_stdlib_escapes_1.patch fixes all invalid escapes in the stdlib. My code was the cause, although no

[issue27364] Deprecate invalid unicode escape sequences

2016-06-26 Thread Emanuel Barry
Changes by Emanuel Barry : Added file: http://bugs.python.org/file43550/invalid_stdlib_escapes_1.patch ___ Python tracker <http://bugs.python.org/issue27364> ___ ___ Pytho

[issue27394] Crash with compile returning a value with an error set

2016-06-26 Thread Emanuel Barry
New submission from Emanuel Barry: My trivial patch exposed a bug in the ast/compiler, where compile() would return a value and set an exception. See http://bugs.python.org/issue27364#msg269323 for more information and steps to reproduce. I looked a bit into it, but I don't know enough

[issue27364] Deprecate invalid unicode escape sequences

2016-06-26 Thread Emanuel Barry
Emanuel Barry added the comment: Ah right, assert() is only enabled in debug mode, I forgot that. My (very uneducated) guess is that compile() got the error (which was a warning) but then decided to return a value anyway, and the next thing that tries to call anything crashes Python. I opened

[issue27394] Crash with compile returning a value with an error set

2016-06-26 Thread Emanuel Barry
Emanuel Barry added the comment: Nevermind, my mistake. -- resolution: -> not a bug stage: needs patch -> resolved status: open -> closed type: crash -> ___ Python tracker <http://bugs.python

[issue27364] Deprecate invalid unicode escape sequences

2016-06-26 Thread Emanuel Barry
Emanuel Barry added the comment: Aaand I feel pretty stupid; I didn't check the return value of PyErr_WarnFormat, so it was my mistake. Attached new patch, actually done right this time. -- Added file: http://bugs.python.org/file43552/deprecate_invalid_escapes_only_2.

[issue27364] Deprecate invalid unicode escape sequences

2016-06-26 Thread Emanuel Barry
Emanuel Barry added the comment: Indeed, we did, thanks for letting me know my mistake :) I didn't get very far into making bytes literal disallow invalid sequences, as I ran into issues with _codecs.escape_decode throwing the warning even when the literal was fine, and I think I st

[issue27364] Deprecate invalid unicode escape sequences

2016-06-27 Thread Emanuel Barry
Emanuel Barry added the comment: I think ultimately a SyntaxError should be fine. I don't know *when* it becomes appropriate to change a warning into an error; I was thinking 3.7 but, as Serhiy said, there's no rush. I think waiting five release cycles is overkill though, that means

[issue27364] Deprecate invalid unicode escape sequences

2016-06-27 Thread Emanuel Barry
Emanuel Barry added the comment: Easing transition is always a good idea. I'll contact the PyCQA people later today when I'm back home. On afterthought, it makes sense to wait more than two release cycles before making this an error. I don't really have a strong opinion wh

[issue27364] Deprecate invalid unicode escape sequences

2016-06-27 Thread Emanuel Barry
Emanuel Barry added the comment: Just brought this to the attention of the code-quality mailing list, so linter maintainers should (hopefully!) catch up soon. Also new patch, I forgot to add '\c' in the tests. -- Added file: http://bugs.python.org

[issue26226] Various test suite failures on Windows

2016-06-28 Thread Emanuel Barry
Emanuel Barry added the comment: Some of the tests that used to fail are now passing, however some are still failing (and new ones are also failing now). Tests that are still failing: test_code_module (TestInteractiveConsole; test_ps1 and test_ps2 failed) test_codecencodings_iso2022 (blame

[issue26226] Various test suite failures on Windows

2016-06-28 Thread Emanuel Barry
Emanuel Barry added the comment: About the strptime failure - it seems time.strftime returns "Est (heure d?été)" while _strptime.LocaleTime().timezone has "est (heure d\x92été)". I don't know why it's like that, but neither are correct - the character that

[issue26226] Various test suite failures on Windows

2016-06-28 Thread Emanuel Barry
Emanuel Barry added the comment: That is good to know, thanks Eryk for the explanation! I also think making Python set LC_CTYPE on startup on Windows would be good. Martin's comment got me wondering, so I'm going to try to see if all modules properly got re-compiled, and re-run t

[issue27423] Failed assertions when running test.test_os on Windows

2016-06-30 Thread Emanuel Barry
New submission from Emanuel Barry: Running test_os yields a ton (something like 20) failed assertion warnings. The attached screenshot is one of them (comes up a few times), but there are others. Choosing to Ignore the error makes Python think that the test was merely skipped without any

[issue27424] Failures in test.test_logging

2016-06-30 Thread Emanuel Barry
New submission from Emanuel Barry: Ran the test as 'python -W error -m test.test_logging' on latest 3.6 version. No idea what causes this; full traceback attached. Not sure if it's relevant, but I'm running Windows 7. -- components: Library (Lib), Tests

[issue27425] Tests fail because of git's newline preferences on Windows

2016-06-30 Thread Emanuel Barry
New submission from Emanuel Barry: Specifically, test_random and test_sax both fail because of git's newline preferences. Mine is set to convert \r\n to \n on push and the other way around on pull. Relevant output: test_random: EException ignored in: <_io.FileIO name=&#x

[issue27426] Encoding mismatch causes some tests to fail on Windows

2016-06-30 Thread Emanuel Barry
New submission from Emanuel Barry: Specifically, test_strptime fails: ss.F.E... == ERROR: test_timezone (__main__.StrptimeTests

[issue26226] Test failures with non-ascii character in hostname on Windows

2016-06-30 Thread Emanuel Barry
Emanuel Barry added the comment: So I checked to make sure everything re-compiled properly and re-ran tests. Now, only a very few fail, and I've opened separate issues for each of them. test_os: #27423 test_logging: #27424 test_random: #27425 test_sax: #27425 test_strptime: #27426 I'

[issue27425] Tests fail because of git's newline preferences on Windows

2016-06-30 Thread Emanuel Barry
Emanuel Barry added the comment: I agree, but I wouldn't expect my line ending preferences to make tests fail. I think that with the move to GitHub already underway, it's not unreasonable to (at least consider to) add a .gitattributes file. Added Brett to nosy since he's resp

[issue27423] Failed assertions when running test.test_os on Windows

2016-06-30 Thread Emanuel Barry
Emanuel Barry added the comment: I'm not sure about the patch - sure, the messages might go away, but I find it concerning that the assertions are failing to begin with. Of course, it only happens when in debug (and this might be a non-issue in practice, I haven't checked), but sh

[issue27439] product function patch

2016-07-02 Thread Emanuel Barry
Emanuel Barry added the comment: What is the use case, and why is a regular for loop not enough? The bar for adding new builtin functions is high, and I don't think this meets it. -- nosy: +ebarry ___ Python tracker <http://bugs.py

[issue27439] Add a product() function to the standard library

2016-07-02 Thread Emanuel Barry
Emanuel Barry added the comment: With the existence of multiple sum() functions (and potentially multiple product() functions), would it be worth it to group these all into one module? It also doesn't help that there is an itertools.product function that has yet another purpose. I mai

[issue27081] Cannot capture sys.stderr output from an uncaught exception in a multiprocessing Process using a multiprocessing Queue

2016-07-02 Thread Emanuel Barry
Emanuel Barry added the comment: Worth of note: #26823 will actually change printing to stderr for recursion errors (if/when it gets merged that is; I don't know what's holding it up). It might be interesting to see if you can still witness this issue with the patch applied. -

[issue27137] Python implementation of `functools.partial` is not a class

2016-07-06 Thread Emanuel Barry
Emanuel Barry added the comment: Is there anything still preventing this from being merged? I think the ability to consistently get the same behaviour, with or without _functools available, outweighs the performance and simplicity loss (and as far as performance loss goes, it appears that

[issue27220] Add a pure Python version of 'collections.defaultdict'

2016-07-06 Thread Emanuel Barry
Emanuel Barry added the comment: Raymond, do you have any interest/time to review this? I can ask someone else, if you prefer. -- ___ Python tracker <http://bugs.python.org/issue27

[issue26823] Shrink recursive tracebacks

2016-07-06 Thread Emanuel Barry
Emanuel Barry added the comment: Sorry for the delay, but here's a patch with updated tests after Nick's suggestions. It should be ready to merge now. (I'm having some failures in test_traceback, but they fail even without my patch) -- Added file: http://bugs.pytho

[issue27242] Make the docs for NotImplemented & NotImplementedError unambiguous

2016-07-06 Thread Emanuel Barry
Emanuel Barry added the comment: New patch with proper indenting, should be good as far as formatting is concerned :) -- Added file: http://bugs.python.org/file43648/NotImplemented_exceptions_wording_5.patch ___ Python tracker <h

[issue27220] Add a pure Python version of 'collections.defaultdict'

2016-07-07 Thread Emanuel Barry
Emanuel Barry added the comment: I agree that CPython itself gains nothing from having this, as this is so that alternate implementations have it as well. I get what you mean about the minor differences, however I think it's a good thing, as it helps to make sure the tests are precise e

[issue27220] Add a pure Python version of 'collections.defaultdict'

2016-07-07 Thread Emanuel Barry
Emanuel Barry added the comment: (Also, if this is going to be rejected still, I think that fixing __all__ to only conditionally add 'deque' and 'defaultdict' should be considered) -- ___ Python tracker <http://bug

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-08 Thread Emanuel Barry
Changes by Emanuel Barry : -- nosy: +ebarry ___ Python tracker <http://bugs.python.org/issue27469> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27468] Erroneous memory behaviour for objects created in another thread

2016-07-08 Thread Emanuel Barry
Changes by Emanuel Barry : -- resolution: -> not a bug stage: -> resolved ___ Python tracker <http://bugs.python.org/issue27468> ___ ___ Python-bugs-list

[issue27498] Regression in repr() of class object

2016-07-13 Thread Emanuel Barry
Changes by Emanuel Barry : -- nosy: +ebarry ___ Python tracker <http://bugs.python.org/issue27498> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27510] Found some Solution build missconfigurations.

2016-07-14 Thread Emanuel Barry
Emanuel Barry added the comment: Please submit a patch file (see https://docs.python.org/devguide/patch.html ). -- nosy: +ebarry stage: -> needs patch ___ Python tracker <http://bugs.python.org/issu

[issue27544] documentiona of dict view types

2016-07-17 Thread Emanuel Barry
Emanuel Barry added the comment: "The #python-dev channel" being me in this context ;) Patch attached. -- keywords: +patch nosy: +ebarry stage: -> patch review Added file: http://bugs.python.org/file43768/dict_view_doc_1.patch ___ P

[issue27544] Document the ABCs for instance/subclass checks of dict view types

2016-07-17 Thread Emanuel Barry
Changes by Emanuel Barry : -- title: documentiona of dict view types -> Document the ABCs for instance/subclass checks of dict view types ___ Python tracker <http://bugs.python.org/issu

[issue27558] SystemError with bare `raise` in threading or multiprocessing

2016-07-18 Thread Emanuel Barry
Changes by Emanuel Barry : -- nosy: +davin, ebarry, pitrou stage: -> needs patch title: SystemError inside multiprocessing.dummy Pool.map -> SystemError with bare `raise` in threading or multiprocessing versions: +Python 3.6 -Python 3.2, Pyth

[issue27364] Deprecate invalid unicode escape sequences

2016-07-18 Thread Emanuel Barry
Emanuel Barry added the comment: Here's a new patch which also deprecates invalid escape sequences in bytes. Tests included with test_codecs. Patch includes and supersedes deprecate_invalid_escapes_only_3.patch, and I have not found a single instance of an invalid escape sequence other

[issue27576] An unexpected difference between dict and OrderedDict

2016-07-19 Thread Emanuel Barry
Changes by Emanuel Barry : -- assignee: -> eric.snow components: +Library (Lib) keywords: +3.5regression -3.4regression nosy: +ebarry, eric.snow stage: -> needs patch ___ Python tracker <http://bugs.python.org/i

[issue27586] Is this a regular expression library bug?

2016-07-21 Thread Emanuel Barry
Emanuel Barry added the comment: For future reference, if your input can have arbitrary escapes, it might be a good idea to pass it through re.escape; it does proper escaping so that stuff like e.g. \g in your input will get treated as a literal backslash, followed by a literal 'g'

[issue26823] Shrink recursive tracebacks

2016-07-23 Thread Emanuel Barry
Emanuel Barry added the comment: After discussing with someone, I realized that the tests actually test the Python implementation twice, and never the C implementation (since I use traceback.print_exc() to "test" the C implementation). I don't think it's possible to both c

[issue26823] Shrink recursive tracebacks

2016-07-23 Thread Emanuel Barry
Emanuel Barry added the comment: Turns out there's already some functions in _testcapi that do this, great! Here's an updated patch actually testing the C implementation (and the tests pass, obviously :) -- Added file: http://bugs.python.org/file43843/short_tracebac

[issue27600] Spam

2016-07-23 Thread Emanuel Barry
Changes by Emanuel Barry : -- components: -Build, XML, email nosy: -barry, r.david.murray, xaxadmin resolution: -> not a bug stage: -> resolved status: open -> closed title: None -> Spam versions: -Python 2.7 ___ Python tr

[issue27601] Minor inaccuracy in hash documentation

2016-07-23 Thread Emanuel Barry
Emanuel Barry added the comment: Indeed, nicely spotted! Patch attached (hash_complex_type_1.patch) P.S.: I don't like the 'hash_' name as a variable for this example; it looks like grit on Tim's monitor to me, so I went ahead and renamed it to 'hash_value'

[issue27601] Minor inaccuracy in hash documentation

2016-07-23 Thread Emanuel Barry
Changes by Emanuel Barry : Added file: http://bugs.python.org/file43846/hash_doc_renamed_1.patch ___ Python tracker <http://bugs.python.org/issue27601> ___ ___ Python-bug

[issue27601] Minor inaccuracy in hash documentation

2016-07-23 Thread Emanuel Barry
Emanuel Barry added the comment: Do note that nothing has been changed in the docs yet. I submitted the patch, and now other developers need to review it, decide whether it's correct or need modifications, and then someone needs to commit it. Let the bikeshedding

[issue26823] Shrink recursive tracebacks

2016-07-24 Thread Emanuel Barry
Emanuel Barry added the comment: Thank you Nick for the comments! Updated patch attached. The new patch uses inspect.stack() to calculate the total stack size, but I'm unable to get the exact number needed, and I found that I'm either 19 or 20 above (depending on whether I run it

[issue26823] Shrink recursive tracebacks

2016-07-24 Thread Emanuel Barry
Emanuel Barry added the comment: Alright, I think this works now. No more magic number, just some regex as well as checking that the number is in range(sys.getrecursionlimit()-50, sys.getrecursionlimit()) :) -- Added file: http://bugs.python.org/file43866/short_tracebacks_7.patch

[issue27608] Something wrong with str.upper().lower() chain?

2016-07-24 Thread Emanuel Barry
Changes by Emanuel Barry : -- resolution: -> not a bug stage: -> resolved ___ Python tracker <http://bugs.python.org/issue27608> ___ ___ Python-bugs-list

[issue27607] Importing the main module twice leads to two incompatible instances

2016-07-24 Thread Emanuel Barry
Emanuel Barry added the comment: I'm fairly sure enums aren't related to this issue, so I'm unassigning Ethan (but feel free to self-assign back if you so desire :). As I said on IRC (I'm Vgr), I think that importing a module twice is the problem here, and that PEP 499 is

[issue27607] Importing the main module twice leads to two incompatible instances

2016-07-25 Thread Emanuel Barry
Emanuel Barry added the comment: @Cameron - I don't think this issue can be solved without the PEP, so possibly that the best move would be to work on the PEP and submit it for another round on Python-Dev, to get it reviewed. Thanks! -- ___ P

[issue27626] Spelling fixes

2016-07-26 Thread Emanuel Barry
New submission from Emanuel Barry: LGTM. -- nosy: +ebarry stage: patch review -> commit review ___ Python tracker <http://bugs.python.org/issue27626> ___ ___ Py

[issue26226] Test failures with non-ascii character in hostname on Windows

2016-07-26 Thread Emanuel Barry
Emanuel Barry added the comment: Since non-ASCII characters are not really supported in hostnames, I changed mine to a saner alternative. This issue can be closed then, since any test failure I encounter can no longer be because of this. One last thing: is it safe to say "Don't use

[issue27629] Cannot create ssl.SSLSocket without existing socket

2016-07-26 Thread Emanuel Barry
Emanuel Barry added the comment: Thank you for the report and the patch! :) This will need a test in Lib/test/test_ssl.py to check for this particular case. I've removed 3.3 and 3.4 from the Versions field, since these versions no longer get regular bugfixes (only security bugfixes may

[issue11048] "import ctypes" causes segfault on read-only filesystem

2016-07-27 Thread Emanuel Barry
Changes by Emanuel Barry : -- stage: test needed -> resolved ___ Python tracker <http://bugs.python.org/issue11048> ___ ___ Python-bugs-list mailing list Un

[issue27623] int.to_bytes() and int.from_bytes(): raise ValueError when bytes count is zero

2016-07-27 Thread Emanuel Barry
Emanuel Barry added the comment: Here's a patch that fixes this. -- components: +Interpreter Core -Library (Lib) keywords: +patch nosy: +ebarry stage: -> patch review Added file: http://bugs.python.org/file43913/int_to_bytes_overflow

[issue27623] int.to_bytes() and int.from_bytes(): raise ValueError when bytes count is zero

2016-07-27 Thread Emanuel Barry
Emanuel Barry added the comment: I don't use this feature enough to have a clear opinion, however it's specifically accounted for in the code and has a test for it. It might be a good idea to bring this up on Python-ideas. It's very likely to break some code, but I wonder if s

[issue27638] int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders

2016-07-27 Thread Emanuel Barry
Emanuel Barry added the comment: Since this is a new feature addition, this should first go through Python-ideas. However, I don't think that network-related features should go into builtin types, -1 from me. -- nosy: +ebarry ___ Python tr

[issue27642] import and __import__() fails silently without a ImportError and does not add the module to the file's namespace.

2016-07-28 Thread Emanuel Barry
Emanuel Barry added the comment: `import` merely adds the imported module to the current namespace which, in your code, is some local (non-global) namespace. It is successfully imported but never used, and quickly falls out of scope. You also check for `testplugin in sys.modules`, but you

[issue27642] import and __import__() fails silently without a ImportError and does not add the module to the file's namespace.

2016-07-28 Thread Emanuel Barry
Emanuel Barry added the comment: Yeah, just add 'global testplugin' at the top of your function, before your import it (you'll also need a global statement if you want to delete/re-import it). You might want to take a look at importlib if you wish to dynamically load modu

[issue27645] Supporting native backup facility of SQLite

2016-07-28 Thread Emanuel Barry
Emanuel Barry added the comment: That's really nice, thank you for doing this! To get your code reviewed, though, you should upload a patch here. With git, you can do 'git diff > my_patch_file_name.patch' in your local repo, then you can upload the resulting file here. If y

[issue27366] PEP487: Simpler customization of class creation

2016-07-30 Thread Emanuel Barry
Emanuel Barry added the comment: Hello Martin, and thank you for your patch! However, this patch removed the ability to pass keyword arguments to `type`, and it's not documented anywhere. I believe it should be documented at least in e.g. the "Changes in the Python API" of th

[issue19660] decorator syntax: allow testlist instead of just dotted_name

2016-07-31 Thread Emanuel Barry
Emanuel Barry added the comment: TL;DR - Use case is dynamic decorators. Not all of the syntax would make sense, see below. The main benefit of this feature would be for dynamic decorators (as was evidenced from others in this issue). In a project I contribute to, we use dynamic decorators

[issue19660] decorator syntax: allow testlist instead of just dotted_name

2016-07-31 Thread Emanuel Barry
Emanuel Barry added the comment: Sure, here goes; this is an IRC game bot which I contribute to. Apologies for the long links, it's the only way to make sure this consistently points to the same place regardless of future commits. The 'cmd' decorator we use is defined at htt

[issue19660] decorator syntax: allow testlist instead of just dotted_name

2016-07-31 Thread Emanuel Barry
Emanuel Barry added the comment: We want to be able to access the instance attributes (as is done e.g. here: https://github.com/lykoss/lykos/blob/1852bf2c442d707ba0cbc16e8c9e012bcbc4fcc5/src/wolfgame.py#L9761 ). I realize we can set the attributes directly on the functions, but we've de

[issue27668] list illogical affectation

2016-08-02 Thread Emanuel Barry
Emanuel Barry added the comment: To add to what SilentGhost just said; the '*' operator for lists doesn't create new lists, but simply creates new references to the same list (i.e. it doesn't re-evaluate the expression). To create separate lists, you can do a list comprehe

[issue27242] Make the docs for NotImplemented & NotImplementedError unambiguous

2016-08-02 Thread Emanuel Barry
Emanuel Barry added the comment: Obligatory monthly ping. -- ___ Python tracker <http://bugs.python.org/issue27242> ___ ___ Python-bugs-list mailing list Unsub

[issue27242] Make the docs for NotImplemented & NotImplementedError unambiguous

2016-08-02 Thread Emanuel Barry
Emanuel Barry added the comment: Thanks Ethan for the improved patch! Pointed out a typo and some nits, but other than that it's mostly good. I'm not that good at brevity, and I think your patch is much better on that regard :) --

[issue27673] lambda function in loop

2016-08-03 Thread Emanuel Barry
Emanuel Barry added the comment: This is due to how closures work in Python: they only look up the value of the variable when the function is executed, not when it is created. See the FAQ for more information and how to work around this: https://docs.python.org/3/faq/programming.html#why-do

[issue25571] Improve the lltrace feature with the Py_Debug mode

2016-08-03 Thread Emanuel Barry
Emanuel Barry added the comment: Left some comments on Rietveld; mostly documentation-related (and pointed out some typos). I'm also +1 on having to specify a True value rather than just defining the variable at all (i.e. setting __ltrace__ to False is the same as not defining it). I

[issue25571] Improve the lltrace feature with the Py_Debug mode

2016-08-03 Thread Emanuel Barry
Emanuel Barry added the comment: Maybe someone who knows this feature better can weigh in, but otherwise LGTM. -- ___ Python tracker <http://bugs.python.org/issue25

[issue27683] ipaddress subnet slicing iterator malfunction

2016-08-04 Thread Emanuel Barry
Emanuel Barry added the comment: Here's a patch that fixes this bug, test included. I made this against the 3.5 branch, but should apply cleanly on default. -- keywords: +patch nosy: +ebarry Added file: http://bugs.python.org/file44008/ipaddress_iter_fix.

[issue27683] ipaddress subnet slicing iterator malfunction

2016-08-04 Thread Emanuel Barry
Changes by Emanuel Barry : -- stage: -> patch review ___ Python tracker <http://bugs.python.org/issue27683> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue27683] ipaddress subnet slicing iterator malfunction

2016-08-05 Thread Emanuel Barry
Emanuel Barry added the comment: Ack, special cases! I can look into making a patch, but I'm not really acquainted with ipaddress or the relevant protocols, so it might not be optimal. I'll give it a shot next week if nobody else does. -- stage: patch review ->

[issue27424] Failures in test.test_logging

2016-08-05 Thread Emanuel Barry
Emanuel Barry added the comment: I'm not home to check, but judging by the error message and previous discussions with other developers, it seems indeed like an issue with a non-ASCII character in my hostname. I've changed my hostname since then, so I'm going to close this as w

[issue27364] Deprecate invalid unicode escape sequences

2016-08-11 Thread Emanuel Barry
Emanuel Barry added the comment: Hmm, that's odd, I recall some of the failures from testing, and thought I fixed them. Some of these are brand new, though, so thanks! I'll run and fix the tests (and modules as well); should likely have a patch by t

[issue27738] odd behavior in creating list of lambda expressions

2016-08-11 Thread Emanuel Barry
Emanuel Barry added the comment: This is due to the fact that Python evaluates the variable 'n' when the function is called, not when it is created. As such, the variable holds the latest value for all functions, and they exhibit identical behaviour. Workaround: ... f = lambda x,

[issue12345] Add math.tau

2016-08-11 Thread Emanuel Barry
Emanuel Barry added the comment: I think that whether or not something is trivial doesn't really correlate to whether or not it has its place in the language. After all, `math.pi` is 3.1416, and most people using pi will not worry about more than 4 decimal digits. Those who do are presu

<    1   2   3   4   5   6   7   8   9   10   >