[issue43420] Optimize rational arithmetics

2021-03-06 Thread Aaron Meurer
Change by Aaron Meurer : -- nosy: +asmeurer ___ Python tracker <https://bugs.python.org/issue43420> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43420] Optimize rational arithmetics

2021-03-07 Thread Aaron Meurer
Aaron Meurer added the comment: I'm surprised to hear that the "typical use-case" of Fraction is fractions converted from floats. Do you have evidence in the wild to support that? I would expect any application that uses fractions "generically" to run into the sam

[issue32958] socket module calls with long host names can fail with idna codec error

2020-07-24 Thread Aaron Black
Aaron Black added the comment: joseph.hackman I don't think that the 63 character limit on a label is the problem specifically, merely it's application. The crux of my issue was that credentials passed with the url in a basic-authy fashion (as some services require) count a

[issue41502] Option for Colored Logging in http.server Module

2020-08-07 Thread Aaron Lichtman
New submission from Aaron Lichtman : It would be useful if the http.server module had an option for colored logging to help users visually parse the HTTP traffic logs. $ python3 -m http.server 80 --color is along the lines of what I'm thinking. -- components: Library (Lib) mes

[issue41506] Inclusion or documentation of extended with syntax in 3.9

2020-08-07 Thread Aaron Meurer
New submission from Aaron Meurer : This discussion started at https://github.com/python/cpython/pull/19503 (actually on Twitter https://twitter.com/asmeurer/status/1289304407696261120), but Guido asked me to move it bpo. Alongside the implementation of Python 3.9's new PEG parser,

[issue35212] Expressions with format specifiers in f-strings give wrong code position in AST

2020-08-31 Thread Aaron Meurer
Aaron Meurer added the comment: The same thing occurs with specifiers like {a!r}. -- nosy: +asmeurer ___ Python tracker <https://bugs.python.org/issue35

[issue30384] traceback.TracebackException.format shouldn't format_exc_only() when __traceback__ is None

2020-11-04 Thread Aaron Meurer
Aaron Meurer added the comment: > It's not entirely clear to me what you are trying to do (what is the output > you are hoping to get?) but this looks more like a question than a bug > report, so I am closing this issue. If this is still relevant, I'd suggest > you a

[issue30384] traceback.TracebackException.format shouldn't format_exc_only() when __traceback__ is None

2020-11-04 Thread Aaron Meurer
Aaron Meurer added the comment: I think I found another way to achieve what I was trying to do, which is why I never pursued this. But I still think it's a bug. __traceback__ = None isn't documented anywhere that I could find, so I was only able to deduce how it should work from r

[issue30384] traceback.TracebackException.format shouldn't format_exc_only() when __traceback__ is None

2020-11-04 Thread Aaron Meurer
Aaron Meurer added the comment: I don't think it's helpful to make such a literalistic interpretation. Just because the variable is called "traceback" doesn't mean it should apply only to the things that are *technically* a traceback (and I don't agree anyway

[issue30384] traceback.TracebackException.format shouldn't format_exc_only() when __traceback__ is None

2020-11-04 Thread Aaron Meurer
Aaron Meurer added the comment: Neither of those things preclude the possibility of the traceback module doing a better job of printing tracebacks for exceptions where __traceback__ = None. -- ___ Python tracker <https://bugs.python.

[issue13992] Segfault in PyTrash_destroy_chain

2012-02-11 Thread Aaron Staley
New submission from Aaron Staley : Am frequently getting segmentation faults with my python program. I am utilizing heavy use of threading and sockets. All sorts of ones are showing in syslog: kernel: [7763578.475590] python[10097]: segfault at 88e5a0 ip 0088e5a0 sp 7f640efd4028

[issue13992] Segfault in PyTrash_destroy_chain

2012-02-11 Thread Aaron Staley
Aaron Staley added the comment: For some more context: Python 2.7.2 Running on Amazon EC2 Linux 3.0.0-14-virtual x86_64 in ubuntu 11.10 170 threads in this particular core dump (another similar crash has 135) -- ___ Python tracker <h

[issue13992] Segfault in PyTrash_destroy_chain

2012-02-12 Thread Aaron Staley
Aaron Staley added the comment: Active extension modules are MySQL-python, numpy, and crypto. Here is the output from the non-optimized debug build. Slightly different trace, but still some sort of deallocator crashing AFAIK: #0 0x0046247c in _Py_ForgetReference (op= , _pipe

[issue13992] Segfault in PyTrash_destroy_chain

2012-02-12 Thread Aaron Staley
Aaron Staley added the comment: As far as I can tell, no other thread is active. Their backtraces are all either: #0 0x7f283dedd300 in sem_wait () from /lib/x86_64-linux-gnu/libpthread.so.0 #1 0x00519295 in PyThread_acquire_lock (lock=0xe7dd50, waitflag=1) at Python

[issue13992] Segfault in PyTrash_destroy_chain

2012-02-12 Thread Aaron Staley
Aaron Staley added the comment: I should note that my program is also affected by this bug: http://bugs.python.org/issue13817 (couldn't isolate it until I used the pydebug configure info). -- ___ Python tracker <http://bugs.python.org/is

[issue13992] Segfault in PyTrash_destroy_chain

2012-02-12 Thread Aaron Staley
Aaron Staley added the comment: Used latest mercurial 2.7 branch and segfault still occurs. -- ___ Python tracker <http://bugs.python.org/issue13992> ___ ___

[issue13992] Segfault in PyTrash_destroy_chain

2012-02-12 Thread Aaron Staley
Aaron Staley added the comment: Also, the only particular things by code does is have a lot of threads (100+), holds open many ssh connections (with paramiko) and I do occasionally use PyThreadState_SetAsyncExc to asynchronously terminate threads

[issue13992] Segfault in PyTrash_destroy_chain

2012-02-13 Thread Aaron Staley
Aaron Staley added the comment: Unfortunately, my application is running so slow under valgrind that behavior is changing, namely the sockets are all timing out. -- ___ Python tracker <http://bugs.python.org/issue13

[issue13992] Segfault in PyTrash_destroy_chain

2012-02-13 Thread Aaron Staley
Aaron Staley added the comment: I see no invalid read/write. Only warnings are some conditional jump depends on uninitialized value in pycrypto's libraries very early on though. The link seems to be a different bug from mine. I did test in python 2.6.7 and the crash still occurs. (I

[issue13992] Segfault in PyTrash_destroy_chain

2012-02-13 Thread Aaron Staley
Aaron Staley added the comment: BTW, I take back what I said about using PyThreadState_SetAsyncExc. Turns out I had a bug where this function would never succeed (was always returning 0). -- ___ Python tracker <http://bugs.python.org/issue13

[issue14537] "Fatal Python error: Cannot recover from stack overflow." with SymPy test suite

2012-04-09 Thread Aaron Meurer
New submission from Aaron Meurer : Recently, after a small seemingly unrelated refactoring, the SymPy test suite in Python 3 started dying with "Fatal Python error: Cannot recover from stack overflow." Here's how to reproduce the error git clone git://github.com/sympy/sympy.

[issue14537] "Fatal Python error: Cannot recover from stack overflow." with SymPy test suite

2012-04-09 Thread Aaron Meurer
Aaron Meurer added the comment: We do have a stack overflow, but this should be raising a RuntimeError, not killing Python. The way it is now, Python dies completely with abort trap 6 (hence the Mac OS X problem report). Sorry if I didn't make this clear in th

[issue14537] "Fatal Python error: Cannot recover from stack overflow." with SymPy test suite

2012-04-09 Thread Aaron Meurer
Aaron Meurer added the comment: No it does not. SymPy is a pure Python library. -- ___ Python tracker <http://bugs.python.org/issue14537> ___ ___ Python-bug

[issue14573] json iterencode can not handle general iterators

2012-04-13 Thread Aaron Staley
New submission from Aaron Staley : The json library's encoder includes a function called 'iterencode'. iterencode allows for encoding to be streamed; as tokens are produced they are yielded. This allows for the encoded object to be streamed to a file, over a socket, etc. witho

[issue32912] Raise non-silent warning for invalid escape sequences

2019-06-05 Thread Aaron Meurer
Aaron Meurer added the comment: I agree with Raymond that third party libraries are not ready for this. My biggest issue is that the way Python warns about this makes it very difficult for library authors to fix this. Most won't even notice. The problem is the warnings are only shown

[issue35586] Open pyexpat compilation, Make shows error(missing separator)

2019-06-10 Thread Aaron Hurst
Aaron Hurst added the comment: I believe this bug can be closed now that the following have landed: New changeset 408a2ef1aceff1f4270c44552fa39ef93d9283e3 by Benjamin Peterson (aaronpaulhurst) in branch 'master': closes bpo-35184: Fix XML_POOR_ENTROPY option that breaks makesetup

[issue32912] Raise non-silent warning for invalid escape sequences

2019-06-14 Thread Aaron Meurer
Aaron Meurer added the comment: I agree. Please someone else do that. I don't know what already has issues and I unfortunately don't have time right now to help out with any of this. I simply mentioned all these things as arguments why Python should not (yet) make these warni

[issue37433] syntax error in f-string in multiline string produces ~40k spaces of output

2019-06-27 Thread Aaron Meurer
Aaron Meurer added the comment: This looks like the same issue I mentioned here https://bugs.python.org/msg344764 -- nosy: +asmeurer ___ Python tracker <https://bugs.python.org/issue37

[issue32912] Raise non-silent warning for invalid escape sequences

2019-07-23 Thread Aaron Meurer
Aaron Meurer added the comment: Raymond, are you in agreement that these warnings should at some point eventually become syntax errors? -- ___ Python tracker <https://bugs.python.org/issue32

[issue32912] Raise non-silent warning for invalid escape sequences

2019-07-23 Thread Aaron Meurer
Aaron Meurer added the comment: Well paradoxically, the bugs that this prevents are the ones it doesn't warn about. If someone writes '\tan(x)' thinking it is a string representing a LaTeX formula for the tangent of x, they won't realize that they actually created a st

[issue37433] syntax error in multiline f-string produces ~40k spaces output

2019-08-02 Thread Aaron Meurer
Aaron Meurer added the comment: This seems related. It's also possible I'm misunderstanding what is supposed to happen here. If you create test.py with just the 2 lines: """ a and run python test.py from CPython master, you get $./python.exe test.py File &quo

[issue32912] Raise non-silent warning for invalid escape sequences

2019-08-09 Thread Aaron Meurer
Aaron Meurer added the comment: Are there issues tracking the things I mentioned, which should IMO happen before this becomes a hard error (making the warnings reproduce even if the file has already been compiled, and making warning message point to the correct line in multiline strings

[issue12154] PyDoc Partial Functions

2017-09-02 Thread Aaron Hall
Aaron Hall added the comment: It seems that this issue is still properly open. (Another open issue seems be related: http://bugs.python.org/issue30129) In the docs on partial, we have: >>> from functools import partial >>> basetwo = partial(int, base=2) >>> basetw

[issue31333] Implement ABCMeta in C

2017-09-03 Thread Aaron Hall
Changes by Aaron Hall : -- nosy: +Aaron Hall ___ Python tracker <http://bugs.python.org/issue31333> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31319] Rename idlelib to just idle

2017-09-03 Thread Aaron Hall
Changes by Aaron Hall : -- nosy: +Aaron Hall ___ Python tracker <http://bugs.python.org/issue31319> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2017-09-03 Thread Aaron Hall
Aaron Hall added the comment: Serhiy, Not sure what else needs to be done to wrap this up. All checks are passing on the pull request. Thoughts? -- ___ Python tracker <http://bugs.python.org/issue26

[issue28972] Document all "python -m" utilities

2017-09-09 Thread Aaron Hall
Aaron Hall added the comment: I like this idea too, but perhaps it should just be a multi-column bulleted list (under the -m flag at https://docs.python.org/3/using/cmdline.html#interface-options) with links to the respective Standard Library doc? Then we just ensure the documentation for

[issue31494] Valgrind suppression file

2017-09-16 Thread Aaron Michaux
New submission from Aaron Michaux: The file "Misc/valgrind-python.supp" doesn't work on Linux x64, running Python3.5.2, when configured as such: --with-pydebug --with-valgrind --without-pymalloc Running the interpreter echo "x = 1; print(x)" | valgrind --tool=m

[issue33899] Tokenize module does not mirror "end-of-input" is newline behavior

2018-11-21 Thread Aaron Meurer
Aaron Meurer added the comment: Is it expected behavior that comments produce NEWLINE if they don't have a newline and don't produce NEWLINE if they do (that is, '# comment' produces NEWLINE but '# comment\n' does not

[issue16482] pdb.set_trace() clobbering traceback on error

2018-12-04 Thread Aaron Meurer
Aaron Meurer added the comment: You can download the branch for a pull request even if the repo is deleted using this https://stackoverflow.com/a/28622034/161801. That will let you keep the original commits intact. -- nosy: +asmeurer ___ Python

[issue6028] Interpreter aborts when chaining an infinite number of exceptions

2017-03-24 Thread Aaron Meurer
Changes by Aaron Meurer : -- nosy: +Aaron.Meurer ___ Python tracker <http://bugs.python.org/issue6028> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28718] '*' matches entire path in fnmatch

2017-03-27 Thread Aaron Whitehouse
Aaron Whitehouse added the comment: Posted to the [Python-ideas] mailing list, as it is proposing a change to a standard library: https://mail.python.org/pipermail/python-ideas/2017-February/044880.html Nobody has responded so far, however. I take this as at least no vehement objection to the

[issue30384] traceback.TracebackException.format shouldn't format_exc_only() when __traceback__ is None

2017-05-16 Thread Aaron Meurer
New submission from Aaron Meurer: I'm trying to completely hide an exception from the traceback module. From reading the source, it looks like the only way to do this is to set __traceback__ to None (I can also set __suppress_context__ to True, but that only works if I have another exce

[issue30449] Improve __slots__ datamodel documentation

2017-05-23 Thread Aaron Hall
New submission from Aaron Hall: The __slots__ documentation in the datamodel needs improvement. For example: > When inheriting from a class without __slots__, the __dict__ attribute of > that class will always be accessible, so a __slots__ definition in the > subclass is meaningl

[issue30449] Improve __slots__ datamodel documentation

2017-05-23 Thread Aaron Hall
Aaron Hall added the comment: I've been working on this section quite a lot, trying to improve the flow of content (which in the prior revision is a bit of a mish-mash of information in the "Notes on using __slots__ section") - I intend to move some of that information into

[issue30463] Add __slots__ to ABC convenience class

2017-05-24 Thread Aaron Hall
New submission from Aaron Hall: We have __slots__ with other ABC's, see http://bugs.python.org/issue11333 and http://bugs.python.org/issue21421. There are no downsides to having empty slots on a non-instantiable class, but it does give the option of denying __dict__ creation for subcla

[issue30449] Improve __slots__ datamodel documentation

2017-05-25 Thread Aaron Hall
Changes by Aaron Hall : -- pull_requests: +1905 ___ Python tracker <http://bugs.python.org/issue30449> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue30449] Improve __slots__ datamodel documentation

2017-05-25 Thread Aaron Hall
Aaron Hall added the comment: I created a new PR based on rhettinger's feedback (which on consideration was quite correct) with a fresh branch from master. Terseness is retained, and I think this revision makes the documentation more correct and complete. The rewording makes the beh

[issue30463] Add __slots__ to ABC convenience class

2017-05-25 Thread Aaron Hall
Changes by Aaron Hall : -- pull_requests: +1908 ___ Python tracker <http://bugs.python.org/issue30463> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2017-06-05 Thread Aaron Hall
Aaron Hall added the comment: Bumping this - I intend to work on this next, if no objections. -- ___ Python tracker <http://bugs.python.org/issue26103> ___ ___

[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2017-06-05 Thread Aaron Hall
Changes by Aaron Hall : -- pull_requests: +2030 ___ Python tracker <http://bugs.python.org/issue26103> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2017-06-06 Thread Aaron Hall
Aaron Hall added the comment: Added news, working on tests -- ___ Python tracker <http://bugs.python.org/issue26103> ___ ___ Python-bugs-list mailing list Unsub

[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2017-06-06 Thread Aaron Hall
Aaron Hall added the comment: > Please also add yourself to Misc/ACKS. Done! -- ___ Python tracker <http://bugs.python.org/issue26103> ___ ___ Python-bugs-lis

[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2017-06-07 Thread Aaron Hall
Aaron Hall added the comment: I tweaked the docs a little more this morning, but I believe I am done making any further changes unless so requested. This issue doesn't say it's assigned to anyone. Is there anything else that needs to h

[issue36370] "Fatal Python error: Cannot recover from stack overflow" from SymPy tests

2019-03-19 Thread Aaron Meurer
New submission from Aaron Meurer : I am getting a Fatal Python error: Cannot recover from stack overflow. running the SymPy tests on a branch of mine where the tests fail. I have reproduced this in Python 3.6.7, as well as CPython master (fc96e5474a7bda1c5dec66420e4467fc9f7ca968). Here are

[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2019-03-20 Thread Aaron Hall
Change by Aaron Hall : -- stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue26103> ___ ___ Pyth

[issue31753] Unnecessary closure in ast.literal_eval

2019-03-20 Thread Aaron Hall
Aaron Hall added the comment: No need to keep this open, I agree with the core developers this shouldn't be changed. -- status: open -> closed ___ Python tracker <https://bugs.python.org

[issue35625] Comprehension doc doesn't mention buggy class scope behavior

2019-04-03 Thread Aaron Hall
Change by Aaron Hall : -- nosy: +Aaron Hall ___ Python tracker <https://bugs.python.org/issue35625> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-07 Thread Aaron Hall
Change by Aaron Hall : -- nosy: +Aaron Hall ___ Python tracker <https://bugs.python.org/issue36551> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35184] Makefile is not correctly generated when compiling pyextat with DXML_POOR_ENTROPY=1

2019-04-21 Thread Aaron Hurst
Change by Aaron Hurst : -- keywords: +patch pull_requests: +12827 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35184> ___ ___ Py

[issue35184] Makefile is not correctly generated when compiling pyextat with DXML_POOR_ENTROPY=1

2019-04-21 Thread Aaron Hurst
Aaron Hurst added the comment: I can reproduce this issue by uncommenting the pyexpat line in Setup.dist and compiling. The issue is with -DXML_POOR_ENTROPY=1. The equals character causes the line to be incorrectly interpreted as a macro definition by makesetup. This results in an

[issue35586] Open pyexpat compilation, Make shows error(missing separator)

2019-04-21 Thread Aaron Hurst
Aaron Hurst added the comment: This is the same issue as https://bugs.python.org/issue35184 I can reproduce this issue by uncommenting the pyexpat line in Setup.dist and compiling. The issue is with -DXML_POOR_ENTROPY=1. The equals character causes the line to be incorrectly interpreted

[issue35184] Makefile is not correctly generated when compiling pyextat with DXML_POOR_ENTROPY=1

2019-05-02 Thread Aaron Hurst
Change by Aaron Hurst : -- pull_requests: +12981 ___ Python tracker <https://bugs.python.org/issue35184> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35184] Makefile is not correctly generated when compiling pyextat with DXML_POOR_ENTROPY=1

2019-05-02 Thread Aaron Hurst
Aaron Hurst added the comment: Sorry for my misunderstanding of the process, and thanks for explaining. I resubmitted the PR against the master branch. -- ___ Python tracker <https://bugs.python.org/issue35

[issue35184] Makefile is not correctly generated when compiling pyextat with DXML_POOR_ENTROPY=1

2019-05-02 Thread Aaron Hurst
Aaron Hurst added the comment: Hi Ned, >From a fresh checkout of master on Ubuntu 18.04, I uncomment the pyexpat line >in Modules/Setup and run: cpython$ ./configure ... cpython$ make Makefile:273: *** missing separator. Stop. Here is the offending section of the resulting Makefile

[issue35184] Makefile is not correctly generated when compiling pyextat with DXML_POOR_ENTROPY=1

2019-05-02 Thread Aaron Hurst
Aaron Hurst added the comment: Hi Ned, Thanks for testing this. I also observe that macOS compiles "without error"... but it's still broken... and silently. This is because the pyexpat line isn't being turned into the expected set of source compilation rules, but

[issue34648] Confirm the types of parameters of traceback.format_list and traceback.StackSummary.from_list post-3.5

2019-05-15 Thread Aaron Hall
Change by Aaron Hall : -- nosy: +Aaron Hall ___ Python tracker <https://bugs.python.org/issue34648> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36927] traceback docstrings should explicitly state return values instead of referring to other functions

2019-05-15 Thread Aaron Hall
New submission from Aaron Hall : I've written three (or more) answers on Stack Overflow about how to use the functions in the traceback module, and I code Python all day long. Embarrassing confession: I just recommended the wrong traceback function in email to fix the incorrect usa

[issue32958] Urllib proxy_bypass crashes for urls containing long basic auth strings

2018-02-26 Thread Aaron Black
New submission from Aaron Black : While working on a custom conda channel with authentication, I ran into the following UnicodeError: Traceback (most recent call last): File "/Users/ablack/miniconda3/lib/python3.6/site-packages/conda/core/repodata.py", li

[issue32977] added acts_like decorator to dataclasses module

2018-03-01 Thread Aaron Christianson
New submission from Aaron Christianson : I'm always writting these wrapper classes where I want to selectively want to expose the interface of some of the methods of certain attributes to co the containing object. This can mean I spend a lot of time implementing wrapper methods. That

[issue32958] socket module calls with long host names can fail with idna codec error

2018-03-02 Thread Aaron Black
Aaron Black added the comment: Just to be clear, I don't know if the socket needs to support 64 character long host name sections, so here's an example url that is at the root of my problem that I'm pretty sure it should support: >>

[issue28677] difficult to parse sentence structure in "When an instance attribute is referenced that isn't a data attribute"

2018-03-23 Thread Aaron Ang
Change by Aaron Ang : -- keywords: +patch pull_requests: +5952 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issue28677> ___ _

[issue31201] make test: module test that failed doesn't exist

2018-04-08 Thread Aaron Ang
Change by Aaron Ang : -- keywords: +patch pull_requests: +6119 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issue31201> ___ _

[issue11594] 2to3 does not preserve line endings

2018-04-15 Thread Aaron Ang
Aaron Ang added the comment: I couldn't reproduce this issue. I tried reproducing this problem by extending the TestRefactoringTool class and creating two files: one file with LF line-endings and one file with CRLF line-endings. The changes that I made can be found here: https://githu

[issue11594] 2to3 does not preserve line endings

2018-04-15 Thread Aaron Ang
Change by Aaron Ang : -- keywords: +patch pull_requests: +6181 stage: test needed -> patch review ___ Python tracker <https://bugs.python.org/issue11594> ___ _

[issue11594] 2to3 does not preserve line endings

2018-04-15 Thread Aaron Ang
Aaron Ang added the comment: @Jason R. Coombs You are right. I managed to reproduce the problem with a test. It only occurs when a fix is applied. Also, I figured out that the refactoring reads in the file using `open(file, 'r')`, which basically transforms all line-endings to LF

[issue33498] pathlib.Path wants an rmtree method

2018-05-14 Thread Aaron Hall
New submission from Aaron Hall : pathlib.Path wants the rmtree method from shutil I think we need this method for a couple of reasons. 1. in shell, rm has the -r flag - In Python, we use shutil.rmtree as a best practice for this. 2. I prefer to teach my students about pathlib.Path as opposed

[issue33498] pathlib.Path wants an rmtree method

2018-05-15 Thread Aaron Hall
Aaron Hall added the comment: > What is wrong with just using shutil.rmtree()? 0. It's awkward to import just for demonstrations. 1. It's harder for new pythonists to discover. 2. A method provides discoverability in an object's namespace. 3. rmtree is a method of paths

[issue31684] Scientific formatting of decimal 0 different from float 0

2017-10-03 Thread Aaron Meurer
New submission from Aaron Meurer : >>> '{:+.19e}'.format(0.) '+0.000e+00' >>> import decimal >>> '{:+.19e}'.format(decimal.Decimal(0)) '+0.000e+19' Note the decimal uses e+19 instead of e+00. Obvi

[issue31684] Scientific formatting of decimal 0 different from float 0

2017-10-04 Thread Aaron Meurer
Aaron Meurer added the comment: I guess I would expect that to be captured by the number of zeros printed (and obviously doing a string format operation with a set number of digits destroys that information). -- ___ Python tracker <ht

[issue31684] Scientific formatting of decimal 0 different from float 0

2017-10-04 Thread Aaron Meurer
Aaron Meurer added the comment: I meant that format() destroys information in a decimal in general. Obviously if you have n digits of precision and format with m < n, then you lose information. I also can't help but feel that we're mixing up "trailing zeros"

[issue31753] Unnecessary closure in ast.literal_eval

2017-10-10 Thread Aaron Hall
New submission from Aaron Hall : Removing the closure seems to make the function about 10% faster. Original source code at: https://github.com/python/cpython/blob/3.6/Lib/ast.py#L40 Empirical evidence: astle.py import timeit from ast import literal_eval as orig_literal_eval from ast import

[issue31753] Unnecessary closure in ast.literal_eval

2017-10-10 Thread Aaron Hall
Aaron Hall added the comment: Rejecting and withdrawing with apologies. -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue31753] Unnecessary closure in ast.literal_eval

2017-10-11 Thread Aaron Hall
Aaron Hall added the comment: So... moving the closure (which may be called recursively) to the global scope actually does improve performance (for small cases, about 10% - larger cases amortize the cost of the closure being built, but in a 100 item dictionary, still about 4% faster to

[issue31742] Default to emitting FutureWarning for provisional APIs

2017-10-13 Thread Aaron Gallagher
Aaron Gallagher <_...@habnab.it> added the comment: >Storing the marker attribute in __main__ [...] Can I request please not using __main__ for this? setuptools console_scripts are very common, which is a case where __main__ will be a generated (i.e. not user-controllable) fil

[issue31753] Unnecessary closure in ast.literal_eval

2017-10-17 Thread Aaron Hall
Aaron Hall added the comment: Static analysis: My mental model currently says the rebuilt function every outer call is an expense with no offsetting benefit. It seems that a function shouldn't build a closure on every call if the closure doesn't close over anything immediately u

[issue31753] Unnecessary closure in ast.literal_eval

2017-10-17 Thread Aaron Hall
Aaron Hall added the comment: New information: I think I have pinpointed at least a contributor to the difference - closure lookups seem to be currently slightly slower (by a few percent) than global lookups (see https://stackoverflow.com/a/46798876/541136). And as we can see, an inner

[issue30670] pprint for dict in sorted order or insert order?

2017-11-02 Thread Aaron Hall
Aaron Hall added the comment: If/when order is guaranteed (3.7?) we should have a pprint that respects current order, -or- we should get an improved pprint (maybe named pp or print?) that understands mappings and other abstract data types. I had a conversation about pprint at the Python

[issue32019] Interactive shell doesn't work with readline bracketed paste

2017-11-13 Thread Aaron Meurer
New submission from Aaron Meurer : Here are the steps to reproduce this: - Compile and link Python against readline version 7.0 or higher. - Add set enable-bracketed-paste on to your ~/.inputrc - Start python and paste the following two lines. Make sure to use a terminal emulator that

[issue24294] DeprecationWarnings should be visible by default in the interactive REPL

2017-11-13 Thread Aaron Meurer
Aaron Meurer added the comment: If it's of any interest to this discussion, for SymPy (for some time) we have used a custom subclass of DeprecationWarning that we enable by default https://github.com/sympy/sympy/blob/master/sympy/utilities/exceptions.py. I don't know if there

[issue32300] print(os.environ.keys()) should only print the keys

2017-12-13 Thread Aaron Meurer
New submission from Aaron Meurer : Take the following scenario which happened to me recently. I am trying to debug an issue on Travis CI involving environment variables. Basically, I am not sure if an environment variable is being set correctly. So in my code, I put print(os.environ.keys

[issue32300] print(os.environ.keys()) should only print the keys

2017-12-13 Thread Aaron Meurer
Aaron Meurer added the comment: So the best fix is to just override keys() in the _Environ class, so that it returns an EnvironKeysView class that overrides __repr__? -- ___ Python tracker <https://bugs.python.org/issue32

[issue32313] Wrong inspect.getsource for datetime

2017-12-13 Thread Aaron Meurer
New submission from Aaron Meurer : inspect.getsource(datetime) shows the Python source code for datetime, even when it is the C extension. This is very confusing. I believe it's because _datetime is used to override everything in datetime at the end of the file (here https://githu

[issue32300] print(os.environ.keys()) should only print the keys

2017-12-14 Thread Aaron Meurer
Aaron Meurer added the comment: Serhiy, isn't option 4? 4. Make KeysView.__repr__ show list(self). Add a custom wrapper for Shelf's KeysView so that it doesn't do this. This seems to be what Victor is suggesting. It makes the most sense to me for the common (i.e., default

[issue32300] print(os.environ.keys()) should only print the keys

2017-12-14 Thread Aaron Meurer
Aaron Meurer added the comment: Can't third party code write their own proxies? Why do we have to do that? -- ___ Python tracker <https://bugs.python.org/is

[issue25457] json dump fails for mixed-type keys when sort_keys is specified

2018-05-20 Thread Aaron Hall
Aaron Hall added the comment: Now that dicts are sortable, does that make the sort_keys argument redundant? Should this bug be changed to "won't fix"? ------ nosy: +Aaron Hall ___ Python tracker <https://bugs.pyt

[issue25457] json dump fails for mixed-type keys when sort_keys is specified

2018-05-21 Thread Aaron Hall
Aaron Hall added the comment: >From a design standpoint, I'm fairly certain the sort_keys argument was >created due to Python's dicts being arbitrarily ordered. Coercing to strings before sorting is unsatisfactory because, e.g. numbers sort lexicographically instead of by nu

[issue32400] inspect.isdatadescriptor false negative

2018-05-22 Thread Aaron Hall
Change by Aaron Hall : -- nosy: +Aaron Hall ___ Python tracker <https://bugs.python.org/issue32400> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue30129] functools.partialmethod should look more like what it's impersonating.

2018-05-28 Thread Aaron Hall
Change by Aaron Hall : -- nosy: +Aaron Hall ___ Python tracker <https://bugs.python.org/issue30129> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12154] PyDoc Partial Functions

2018-05-28 Thread Aaron Hall
Aaron Hall added the comment: Should pydoc treat a partial object like a function? Should a partial be an instance of a function? Should we be able to add all the nice things that functions have to it? If we want that, should we simply instantiate a function the normal way, with a new

<    1   2   3   4   >