[issue3323] Clarify __slots__ behaviour when inheriting

2008-07-09 Thread Andy
New submission from Andy <[EMAIL PROTECTED]>: Suggest clarification on behaviour of the __slots__ attribute when inheriting from classes that don't have __slots__ defined. Obviously the superclass automatically creates __dict__, and it seems the subclass inherits this. I presume this

[issue3353] make built-in tokenizer available via Python C API

2008-07-23 Thread Andy
Andy <[EMAIL PROTECTED]> added the comment: Sorry for the terribly dumb question about this. Are you meaning that, at this stage, all that is required is: 1. the application of the PyAPI_FUNC macro 2. move the file to the Include directory 3. update Makefile.pre.in to point to t

[issue3353] make built-in tokenizer available via Python C API

2008-07-26 Thread Andy
Andy <[EMAIL PROTECTED]> added the comment: Did that and it builds fine. So my test procedure was: - checkout clean source - apply patch as per guidelines - remove the file Psrser/tokenizer.h (*) - ./configure - make - ./python setup.py install Build platform: Ubuntu , gcc 4.2.

[issue3713] Compile warning for Objects/stringlib

2008-08-28 Thread Andy
New submission from Andy <[EMAIL PROTECTED]>: Checked out the PY3K branch and built. Received a warning about "characters after #ifdef ignored" from Objects/stringlib/find.h the line in question is: #ifdef STRINGLIB_WANT_CONTAINS_OBJ && !defined(FROM_BYTEARRAY) Whic

[issue3713] Compile warning for Objects/stringlib

2008-08-28 Thread Andy
Andy <[EMAIL PROTECTED]> added the comment: patch for issue attached. gcc -v => gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu7) tests: ./runtests.sh => 0 BAD 297 GOOD 27 SKIPPED 324 total -- keywords: +patch Added file: http://bugs.python.org/file11291/iss

[issue4279] Module 'parser' fails to build

2008-11-07 Thread Andy
New submission from Andy <[EMAIL PROTECTED]>: With a clean checkout of the py3k source it fails to build the Parser exension module (based on Modules/parsermodule.c) when building against a cygwin target. This appears to be related to the movement of the symbol _PyParser_Gramma

[issue4279] Module 'parser' fails to build

2008-11-09 Thread Andy
Andy <[EMAIL PROTECTED]> added the comment: bah I *am* a idiot, #4288 and Christian's comments point out that I can't use 'find' & 'xargs' properly :-( Will modify patch to use the correct grammar file &c. (and maybe one day I might actually say some

[issue4279] Module 'parser' fails to build

2008-11-09 Thread Andy
Changes by Andy <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file11960/parsermodule_fix.diff ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.pytho

[issue4279] Module 'parser' fails to build

2008-11-09 Thread Andy
Andy <[EMAIL PROTECTED]> added the comment: a new patch that will use the grammar definition from Python/graminit.c - it is as of yet untested for Cygwin (can't get to that machine right now). It follows the same pattern as the previous, i.e. it makes us of an accessor function

[issue4288] parsermodule and grammar variable

2008-11-09 Thread Andy
Andy <[EMAIL PROTECTED]> added the comment: looks like it might be a similar root issue to the one I raised in #4279. Looks like this patch breaks the data hiding that I think has been attempted :-( though it doesn't mess with setup.py in the way mine does :-) Don't know

[issue4288] parsermodule and grammar variable

2008-11-09 Thread Andy
Andy <[EMAIL PROTECTED]> added the comment: Christian: sorry my 'find' kung fu is weak :-( :-$ I see why. Will work on a better patch. ___ Python tracker <[EMAIL PROTECTED]> <http://

[issue4279] Module 'parser' fails to build

2008-11-10 Thread Andy
Andy <[EMAIL PROTECTED]> added the comment: Martin: Looking at it I agree with you 100% - the patch is too complicated for what it is intending to resolve. It simply does not need another accessor function to muddy the waters when making the symbol public as done in #4288 resolves the

[issue4288] parsermodule and grammar variable

2008-11-09 Thread Andy
Andy <[EMAIL PROTECTED]> added the comment: Christian: Cool, thanks for the feedback d00d - it took longer than i though to get what I predicted :-) No worries on the whole "core target" platform thing - I understand it perfectly, had the same issue for work related things: t

[issue37871] 40 * 473 grid of "é" has a single wrong character on Windows

2019-08-15 Thread ANdy
New submission from ANdy : # To reproduce: # Put this text in a file `a.py` and run `py a.py`. # Or just run: py -c "print(('é' * 40 + '\n') * 473)" # Scroll up for a while. One of the lines will be: # ��ééé # (You can spot thi

[issue31809] ssl module unnecessarily pins the client curve when using ECDH

2017-10-18 Thread Andy
Andy added the comment: While debugging I reproduced this on - 'OpenSSL 1.1.0f 25 May 2017' - 'OpenSSL 1.0.1f 6 Jan 2014' - and 'BoringSSL', latest. using Python 2.7.12, 2.7.13, 2.7.6 and 3.5.3. This was all on Debian. Note that since I used Python <2.7.1

[issue31809] ssl module unnecessarily pins the client curve when using ECDH

2017-10-25 Thread Andy
Andy added the comment: Thanks for adding the test! If the official stance is that only the latest OpenSSL is supported then this is definitely WAI. Sounds like a good policy... I'll close this issue. -- resolution: -> not a bug stage: -> resolved status: ope

[issue5166] ElementTree and minidom don't prevent creation of not well-formed XML

2009-11-24 Thread Andy
Andy added the comment: I'm also of the opinion that this would be a valuable feature to have. I think it's a reasonable expectation that an XML library produces valid XML. It's particularly strange that ET would output XML that it can't itself read. Surely the job of ma

[issue42548] debugger stops at breakpoint of `pass` that is not actually reached

2022-02-07 Thread Andy S
Andy S added the comment: Can reproduce this on 3.9. Is the fact 3.9 is in `bugfix` status enough to backport any fixing changes from 3.11 (if that's true and the bug was fixed)? -- ___ Python tracker <https://bugs.python.org/is

[issue42548] debugger stops at breakpoint of `pass` that is not actually reached

2022-02-07 Thread Andy S
Andy S added the comment: Then maybe those RMs (for 3.9 and 3.10) should decide on their own? That should mean the bug should be reopened for them to get assigned to. -- ___ Python tracker <https://bugs.python.org/issue42

[issue1235] CGIHTTPRequestHandler.run_cgi() does not run on Windows if sys.executable contains blanks

2007-10-04 Thread Andy Schumann
New submission from Andy Schumann: On Windows a path can contain spaces (e.g. C:\Program Files\python22 \python.exe). If using popenx each component in a command line has therefore to be double quoted as well as the whole command string. The method run_cgi() of the class CGIHTTPRequestHandler

[issue12584] win.protocol('WM_DELETE_WINDOW'...) still deletes window on OSX

2011-07-18 Thread Andy Wildenberg
New submission from Andy Wildenberg : This was originally posted on http://stackoverflow.com/questions/1800452/how-to-intercept-wm-delete-window-on-osx-using-tkinter but seems not to have been reported as a bug. On OS X (10.6.8, python 2.6.1) register a protocol on 'WM_DELETE_WINDOW&#x

[issue2292] Missing *-unpacking generalizations

2010-09-14 Thread Andy Buckley
Changes by Andy Buckley : -- nosy: +andybuckley ___ Python tracker <http://bugs.python.org/issue2292> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11339] annotation for class being defined

2011-02-26 Thread Andy Harrington
New submission from Andy Harrington : You cannot make a self-referential annotation like class Graph: def reverse(self) -> Graph: # ... This corresponds to a common coding situation. -- components: Interpreter Core messages: 129587 nosy: andyharrington priority: nor

[issue858809] Use directories from configure rather than hardcoded

2011-03-16 Thread Andy Buckley
Changes by Andy Buckley : -- nosy: +andybuckley ___ Python tracker <http://bugs.python.org/issue858809> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1294959] Problems with /usr/lib64 builds.

2011-03-16 Thread Andy Buckley
Changes by Andy Buckley : -- nosy: +andybuckley ___ Python tracker <http://bugs.python.org/issue1294959> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5755] "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++"

2010-12-23 Thread Andy Bailey
Changes by Andy Bailey : -- nosy: +GooseYArd ___ Python tracker <http://bugs.python.org/issue5755> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Andy Harrington
Andy Harrington added the comment: I found a similar issue. If you want more simple files demonstrating the issue, I have attached some. If I start my localCGIServer.py, then I can use adder.html fine (uses get), but with adderpost.html (uses post) the cgi action file, adder.cgi (that

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Andy Harrington
Changes by Andy Harrington : Removed file: http://bugs.python.org/file20392/localCGIServer.py ___ Python tracker <http://bugs.python.org/issue4953> ___ ___ Python-bug

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Andy Harrington
Changes by Andy Harrington : Added file: http://bugs.python.org/file20393/adder.html ___ Python tracker <http://bugs.python.org/issue4953> ___ ___ Python-bugs-list mailin

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Andy Harrington
Changes by Andy Harrington : Added file: http://bugs.python.org/file20394/adderpost.html ___ Python tracker <http://bugs.python.org/issue4953> ___ ___ Python-bugs-list m

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Andy Harrington
Changes by Andy Harrington : Added file: http://bugs.python.org/file20395/localCGIServer.py ___ Python tracker <http://bugs.python.org/issue4953> ___ ___ Python-bug

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-13 Thread Andy Harrington
Changes by Andy Harrington : Added file: http://bugs.python.org/file20396/adder.cgi ___ Python tracker <http://bugs.python.org/issue4953> ___ ___ Python-bugs-list mailin

[issue2950] silly readline module problem

2008-05-23 Thread Andy Novocin
New submission from Andy Novocin <[EMAIL PROTECTED]>: I installed python 2.5.2 on my SUSE 10.3 system which came with 2.4.4 and when you type import readline it returns No module named readline. When installing I just unzipped, ./configure, make, sudo make install. Im brand new to Lin

[issue3570] str.find docstring typo

2008-08-16 Thread Andy Harrington
New submission from Andy Harrington <[EMAIL PROTECTED]>: When you enter help("".find) you get ... such that sub is contained within s[start,end] ... s[start, end] makes no sense. It should be s[start:end]. -- assignee: georg.brandl components: Documentation mess

[issue3704] cookielib doesn't handle URLs with / in parameters

2008-08-27 Thread Andy Kilpatrick
New submission from Andy Kilpatrick <[EMAIL PROTECTED]>: cookielib doesn't handle URLs like "http://server/script? err=/base/error.html&ok=/base/ok.html", as CookieJar::_cookie_from_cookie_tuple uses rfind("/") to strip off the end of the URL, returni

[issue4256] optparse: provide a simple way to get a programmatically useful list of options

2010-04-03 Thread Andy Buckley
Andy Buckley added the comment: That sort of idea, yes: just a wild thought, but it would be really nice if this was available so that in combination with a standard bash/zsh function, getting basic automatic command completion for scripts built with optparse (and any other implementer of

[issue4256] optparse: provide a simple way to get a programmatically useful list of options

2010-04-05 Thread Andy Buckley
Andy Buckley added the comment: Thanks for the pointers to both of these... I wasn't aware of either. I see argparse has been recently approved for Python stdlib inclusion, too: http://www.python.org/dev/peps/pep-0389/ Congratulations! As far as I can tell, genzshcomp is parsing the o

[issue8379] if __debug__: has nonobvious behaviour when evaluating .pyo without -O

2010-04-12 Thread Andy Friesen
New submission from Andy Friesen : In certain circumstances, "if __debug__" seems to be evaluating its "else" clause even when -O is not specified. This can cause very surprising behavior. a.zip contains a single file named a/__init__.pyo. It is the compiled form of

[issue4256] optparse: provide a simple way to get a programmatically useful list of options

2010-04-21 Thread Andy Buckley
Andy Buckley added the comment: > The backward compatible solution is to have --help-options disabled by > default, and ask people to enable it with add_interface=True. Or to add the option just before arg parsing, if it has not already been defined? Thanks for the patches, Filip!

[issue2398] test_errno fails with unexpected error value EREMOTEIO

2008-03-18 Thread Andy Balaam
New submission from Andy Balaam <[EMAIL PROTECTED]>: Running test_errno on my 32-bit Ubuntu Gutsy machine gives me this: $ ./python Lib/test/test_errno.py test_for_improper_attributes (__main__.ErrnoAttributeTests) ... FAIL test_using_errorcode (__main__.ErrnoAttributeTests)

[issue2398] test_errno fails with unexpected error value EREMOTEIO

2008-03-18 Thread Andy Balaam
Andy Balaam <[EMAIL PROTECTED]> added the comment: Adding Brett Cannon since it looks like his checkin created the test which fails on my machine. Apologies if this is very bad etiquette. I couldn't find any guidelines about this in the developers' docs, but probably tha

[issue2398] test_errno fails with unexpected error value EREMOTEIO

2008-03-18 Thread Andy Balaam
Andy Balaam <[EMAIL PROTECTED]> added the comment: Woah! fast response, and what looks like a much more sensible fix. Thanks Brett. __ Tracker <[EMAIL PROTECTED]> <http://bugs.pytho

[issue1038909] pydoc method documentation lookup enhancement

2008-03-20 Thread Andy Harrington
Andy Harrington <[EMAIL PROTECTED]> added the comment: After going to the sprint Monday, I am working on this as my first patch. There is no test file for pydoc. ?? -- nosy: +andyharrington _ Tracker <[EMAIL PROTECTED]> <http://

[issue1038909] pydoc method documentation lookup enhancement

2008-03-22 Thread Andy Harrington
Andy Harrington <[EMAIL PROTECTED]> added the comment: Several points: Additional note in pydoc output: I thought that 'inherited' docs should be marked, so I chose to add to the note for any function that gets docs displayed from an inherited function: ', docs from

[issue1038909] pydoc method documentation lookup enhancement

2008-03-23 Thread Andy Harrington
Changes by Andy Harrington <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file9823/pydoc.PATCH _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.o

[issue1038909] pydoc method documentation lookup enhancement

2008-03-23 Thread Andy Harrington
Andy Harrington <[EMAIL PROTECTED]> added the comment: HM, before writing my patch I tested pydoc to see the issue was still there. I did not look at the 2004 patch from aschmolck since it was so old and was clearly not implemented, and brett just listed this issue as one to deal with i

[issue1038909] pydoc method documentation lookup enhancement

2008-03-24 Thread Andy Harrington
Andy Harrington <[EMAIL PROTECTED]> added the comment: Alexander, I have no idea why your patch languished. On the one hand I might have skipped this if I realized that before. On the other hand, I did add something extra, and I might not have had an open mind if I had looked at yours.

[issue4256] optparse: provide a simple way to get a programmatically useful list of options

2008-11-03 Thread Andy Buckley
New submission from Andy Buckley <[EMAIL PROTECTED]>: optparse is a great option parser, but one thing that would make it even greater would be if it provided a standard option (cf. --help) which lists all the available options in a parseable form. Something prefixed with --help, e.g.

[issue4672] Distutils SWIG support blocks use of SWIG -outdir option

2008-12-15 Thread Andy Buckley
New submission from Andy Buckley : When using distutils to build an extension module using SWIG, it makes most sense to use the built-in SWIG support. However, the distutils seem to "vet" the options passed via the Extension.swig_opts attr/arg: [...] ext_modules=[Extensi

[issue4673] Distutils should provide an uninstall command

2008-12-15 Thread Andy Buckley
New submission from Andy Buckley : It would make package maintenance easier, as well as integration with other build systems e.g. autotools (necessary for projects where not everything is Python), if the distutils supported an uninstallation command, e.g. python setup.py uninstall This would

[issue1479255] Fix building with SWIG's -c++ option set in setup.py

2008-12-15 Thread Andy Buckley
Andy Buckley added the comment: This works in my current version of distutils (Python 2.5.2, from Ubuntu Intrepid). Maybe it was fixed and no-one noticed that this bug was relevant ;) -- nosy: +andybuckley ___ Python tracker <http://bugs.python.

[issue4672] Distutils SWIG support blocks use of SWIG -outdir option

2009-01-26 Thread Andy Buckley
Andy Buckley added the comment: Dumb question, but why is distutils wrapping the command args in quotes anyway? I'm not even sure why lists are being used (rather than a string) for the options, except that lists are a bit more "Pythony" and can be used to semantically divide t

[issue5070] Distutils should create install dir if needed

2009-01-26 Thread Andy Buckley
New submission from Andy Buckley : If you attempt to call "python setup.py install --prefix=/foo", and /foo/lib/pythonX.Y/site-packages does not exist, the installation will fail, requiring that the directory be made by hand. Since there is no easy way to know in advance (other than

[issue5071] Distutils should not fail if install dir is not in PYTHONPATH

2009-01-26 Thread Andy Buckley
New submission from Andy Buckley : At present, distutils exits with an error return code if the directory that modules are being installed into is not in PYTHONPATH. Since the install path is not easily obtained (it at least requires running Python to work out the version string, plus some

[issue5070] Distutils should create install dir if needed

2009-01-26 Thread Andy Buckley
Andy Buckley added the comment: Thanks for the rapid feedback: yes, I am using setuptools and didn't realise it would be responsible for this override. Is setuptools feedback done completely independently from this tracker? ___ Python tracker

[issue4673] Distutils should provide an uninstall command

2009-01-27 Thread Andy Buckley
Andy Buckley added the comment: If an uninstall registry is feasible, the it could be neat. The suggested behaviour of unlinking known files based on the source directory is not all that inconvenient: it's by no means perfect, but it has its uses and is familiar to many, since it is ho

[issue4151] Separate build dir broken

2009-02-16 Thread Andy Buckley
Andy Buckley added the comment: I'm having trouble with this as well :( It's pretty much a blocker for integrating distutils-based extension builds with an autotools library build, because the "make distcheck" target explicitly does the build in a subtree of the source

[issue43828] MappingProxyType accepts string

2021-04-13 Thread Andy Maier
New submission from Andy Maier : MappingProxyType objects can currently be initialized from a string object. Given is purpose, I think this is a bug and should result in TypeError being raised. Example code (on CPython 3.9.1): >>> from types import MappingProxyType >>> mp

[issue43828] MappingProxyType accepts string

2021-04-13 Thread Andy Maier
Change by Andy Maier : -- type: -> behavior ___ Python tracker <https://bugs.python.org/issue43828> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue43829] MappingProxyType cannot hash a hashable underlying mapping

2021-04-13 Thread Andy Maier
New submission from Andy Maier : Objects of MappingProxyType do expose a __hash__() method, but if the underlying mapping is hashable, it still does not support hashing it. Example: Content of mp_hash.py: -- #!/usr/bin/env python from nocasedict import NocaseDict, HashableMixin from

[issue43828] MappingProxyType accepts string

2021-04-13 Thread Andy Maier
Andy Maier added the comment: I accept that the issue was closed, but wanted to document some things: 1. The dict class manages very well to detect that a string is invalid input: >>> d = dict('abc') Traceback (most recent call last): File "", line 1, in

[issue43858] Provide method to get list of logging level names

2021-04-15 Thread Andy Lowry
New submission from Andy Lowry : It would be useful to have something like a `getLevelNames` method to return the current list of level names, ordered by priority. This currently appears to be available only by accessing a private member, like `_levelToName` or `_nameToLevel`. This

[issue43912] http.client.BadStatusLine raised and response contains request

2021-04-22 Thread Andy Maier
New submission from Andy Maier : Hello, we have a nasty occurrence of BadStatusLine that shows the status line of the request(!!) in one of our projects. That exception is raised when checking a response and should check the response, not the request. Further debugging revealed that not

[issue43912] http.client.BadStatusLine raised and response contains request

2021-04-22 Thread Andy Maier
Andy Maier added the comment: I should have added that my local system is macOS, and that "up to 3.9" means I only tried up to 3.9. -- ___ Python tracker <https://bugs.python.o

[issue44070] Regression with relative paths in sys.path in python 3.8.10

2021-05-07 Thread Andy Fiddaman
Andy Fiddaman added the comment: I've just found this while investigating a regression with my project following update to 3.9.5. It took me some time to discover that the new test failures were due to __file__ now being fully qualified when it wasn't before. As far as I can tell

[issue43858] Provide method to get list of logging level names

2021-05-30 Thread Andy Lowry
Andy Lowry added the comment: @andrei.avk Yes, that sounds just fine. Many thanks. -- ___ Python tracker <https://bugs.python.org/issue43858> ___ ___ Python-bug

[issue38810] SSL connect() raises SSLError "[SSL] EC lib (_ssl.c:728)"

2019-11-15 Thread Andy Maier
New submission from Andy Maier : A user of our pywbem package gets an SSLError with message "[SSL] EC lib (_ssl.c:728)" when invoking the connect() method on an SSL wrapped socket. See https://github.com/pywbem/pywbem/issues/1950. The issue is that with this error message, it is no

[issue38810] SSL connect() raises SSLError "[SSL] EC lib (_ssl.c:728)"

2019-11-15 Thread Andy Maier
Andy Maier added the comment: More details about the environment this happens on: Python 3.5.7 (default, Aug 16 2019, 10:17:32) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux -- ___ Python tracker <https://bugs.python.org/issue38

[issue38810] SSL connect() raises SSLError "[SSL] EC lib (_ssl.c:728)"

2019-11-26 Thread Andy Maier
Andy Maier added the comment: Our user was able to fix this issue by upgrading the OpenSSL version used on the client side from 1.0.1e-fips to 1.1.1. It seems to me that Python's SSL support cannot do anything about this issue. As far as I'm concerned ths issue can

[issue38810] SSL connect() raises SSLError "[SSL] EC lib (_ssl.c:728)"

2019-11-26 Thread Andy Maier
Andy Maier added the comment: Thanks for the help, Christian! -- ___ Python tracker <https://bugs.python.org/issue38810> ___ ___ Python-bugs-list mailin

[issue39127] _Py_HashPointer's void * argument should be const

2019-12-23 Thread Andy Lester
New submission from Andy Lester : _Py_HashPointer in Python/pyhash.c takes a pointer argument that can be made const. This will let compiler and static analyzers know that the pointer's target is not modified. You can also change calls to _Py_HashPointer that are down-casting poi

[issue39127] _Py_HashPointer's void * argument should be const

2019-12-23 Thread Andy Lester
Change by Andy Lester : -- keywords: +patch pull_requests: +17145 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17690 ___ Python tracker <https://bugs.python.org/issu

[issue39150] See if PyToken_OneChar would be faster as a lookup table

2019-12-28 Thread Andy Lester
New submission from Andy Lester : PyToken_OneChar in Parser/token.c is autogenerated. I suspect it may be faster and smaller if it were a lookup into a static table of ops rather than a switch statement. Check to see if it is. -- components: Interpreter Core messages: 358975 nosy

[issue39150] See if PyToken_OneChar would be faster as a lookup table

2019-12-28 Thread Andy Lester
Andy Lester added the comment: Thank you. I appreciate the pointer. -- ___ Python tracker <https://bugs.python.org/issue39150> ___ ___ Python-bugs-list mailin

[issue39146] too much memory consumption in re.compile unicode

2020-01-03 Thread Andy Lester
Change by Andy Lester : -- components: +Regular Expressions -Library (Lib) nosy: +ezio.melotti, mrabarnett ___ Python tracker <https://bugs.python.org/issue39

[issue39150] See if PyToken_OneChar would be faster as a lookup table

2020-01-08 Thread Andy Lester
Andy Lester added the comment: I tried out some experimenting with the lookup table vs. the switch statement. The relevant diff (not including the patches to the code generator) is: --- Parser/token.c +++ Parser/token.c @@ -77,31 +77,36 @@ int PyToken_OneChar(int c1) { -switch (c1

[issue39150] See if PyToken_OneChar would be faster as a lookup table

2020-01-09 Thread Andy Lester
Andy Lester added the comment: Yes, I ran it multiple times on my 2013 Macbook Pro and got ~10% speedup. I also ran it on my Linux VM (that I only use for development) and got a speedup but less so. The code I used to run the tests is at: https://github.com/petdance/cpython/blob

[issue39150] See if PyToken_OneChar would be faster as a lookup table

2020-01-09 Thread Andy Lester
Andy Lester added the comment: Re: branch prediction. The branch if (c1>=37 && c1<=126) could just as easily be if (c1>=0 && c1<=126) with no other changes to the code. It could be just if (c1<=126) if c1 wasn't signed. As far as

[issue39588] Use memcpy() instead of for() loops in _PyUnicode_To*

2020-02-08 Thread Andy Lester
New submission from Andy Lester : Four functions in Objects/unicodectype.c copy values out of lookup tables with a for loop int i; for (i = 0; i < n; i++) res[i] = _PyUnicode_ExtendedCase[index + i]; instead of a memcpy memcpy(

[issue39150] See if PyToken_OneChar would be faster as a lookup table

2020-02-08 Thread Andy Lester
Andy Lester added the comment: I'm closing this as it seems there's not much interest in this. -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.py

[issue39588] Use memcpy() instead of for() loops in _PyUnicode_To*

2020-02-08 Thread Andy Lester
Andy Lester added the comment: Thanks for replying. I figured that might be the case, which is why I made a ticket before bothering with a pull request. I've also seen this kind of thing around: i = ctx->pattern[0]; Py_ssize_t groupref = i+i; in

[issue39591] Functions in Python/traceback.c can take const pointer arguments

2020-02-08 Thread Andy Lester
New submission from Andy Lester : The functions tb_displayline and tb_printinternal can take const pointers on some of their arguments. tb_displayline(PyObject *f, PyObject *filename, int lineno, const PyObject *name) tb_printinternal(const PyTracebackObject *tb, PyObject *f, long limit

[issue39491] Import PEP 593 (Flexible function and variable annotations) support already implemented in typing_extensions

2020-02-08 Thread Andy Lester
Change by Andy Lester : -- pull_requests: +17793 pull_request: https://github.com/python/cpython/pull/18420 ___ Python tracker <https://bugs.python.org/issue39

[issue39591] Functions in Python/traceback.c can take const pointer arguments

2020-02-08 Thread Andy Lester
Change by Andy Lester : -- keywords: +patch pull_requests: +17794 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18420 ___ Python tracker <https://bugs.python.org/issu

[issue39491] Import PEP 593 (Flexible function and variable annotations) support already implemented in typing_extensions

2020-02-08 Thread Andy Lester
Change by Andy Lester : -- pull_requests: +17797 pull_request: https://github.com/python/cpython/pull/18422 ___ Python tracker <https://bugs.python.org/issue39

[issue39591] Functions in Python/traceback.c can take const pointer arguments

2020-02-08 Thread Andy Lester
Change by Andy Lester : -- pull_requests: -17794 ___ Python tracker <https://bugs.python.org/issue39591> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39591] Functions in Python/traceback.c can take const pointer arguments

2020-02-08 Thread Andy Lester
Change by Andy Lester : -- pull_requests: +17798 pull_request: https://github.com/python/cpython/pull/18422 ___ Python tracker <https://bugs.python.org/issue39

[issue39491] Import PEP 593 (Flexible function and variable annotations) support already implemented in typing_extensions

2020-02-08 Thread Andy Lester
Change by Andy Lester : -- pull_requests: +17799 pull_request: https://github.com/python/cpython/pull/18422 ___ Python tracker <https://bugs.python.org/issue39

[issue39591] Functions in Python/traceback.c can take const pointer arguments

2020-02-09 Thread Andy Lester
Change by Andy Lester : -- pull_requests: -17798 ___ Python tracker <https://bugs.python.org/issue39591> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39591] Functions in Python/traceback.c can take const pointer arguments

2020-02-09 Thread Andy Lester
Andy Lester added the comment: I'm sorry, I think my comment was misleading. The changes I had proposed were not making the object itself const, but some of the arguments in the static worker functions. For example: -tb_displayline(PyObject *f, PyObject *filename, int lineno, PyO

[issue39591] Functions in Python/traceback.c can take const pointer arguments

2020-02-10 Thread Andy Lester
Andy Lester added the comment: > Yes, Py_INCREF and Py_DECREF change the type, and therefore constness. Understood. The changes that I have proposed are not to objects that get sent through Py_INCREF/Py_DECREF. If they did, -Wcast-qual would have caught it. -Wcast-qual catches if you c

[issue39605] Fix some casts to not cast away const

2020-02-10 Thread Andy Lester
New submission from Andy Lester : gcc -Wcast-qual turns up a number of instances of casting away constness of pointers. Some of these can be safely modified, by either: * Adding the const to the type cast, as in: -return _PyUnicode_FromUCS1((unsigned char*)s, size); +return

[issue39605] Fix some casts to not cast away const

2020-02-10 Thread Andy Lester
Change by Andy Lester : -- keywords: +patch pull_requests: +17827 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18453 ___ Python tracker <https://bugs.python.org/issu

[issue39620] PyObject_GetAttrString and tp_getattr do not agree

2020-02-12 Thread Andy Lester
New submission from Andy Lester : PyObject_GetAttrString(PyObject *v, const char *name) typedef PyObject *(*getattrfunc)(PyObject *, char *) The outer PyObject_GetAttrString takes a const char *name, but then casts away the const when calling the underlying tp_getattr. This means that an

[issue39620] PyObject_GetAttrString and tp_getattr do not agree

2020-02-12 Thread Andy Lester
Andy Lester added the comment: Do you know why it was reverted? (Granted, it was 15 years ago...) It looks like the original changeset is trying to address at least two different problems with non-const string literals. My ticket here is focusing only on getattrfunc and setattrfunc. The

[issue39621] md5_compress() in Modules/md5module.c can take a const buf

2020-02-12 Thread Andy Lester
New submission from Andy Lester : The function md5_compress does not modify its buffer argument. static void md5_compress(struct md5_state *md5, unsigned char *buf) buf should be const. -- components: Extension Modules messages: 361932 nosy: petdance priority: normal severity: normal

[issue39621] md5_compress() in Modules/md5module.c can take a const buf

2020-02-12 Thread Andy Lester
Change by Andy Lester : -- keywords: +patch pull_requests: +17871 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18497 ___ Python tracker <https://bugs.python.org/issu

[issue39630] Const some pointers to string literals

2020-02-13 Thread Andy Lester
New submission from Andy Lester : Here are some fixes of char * pointers to literals that should be const char * in these four files. +++ Objects/frameobject.c +++ Objects/genobject.c +++ Python/codecs.c +++ Python/errors.c -- components: Interpreter Core messages: 361982 nosy

[issue39630] Const some pointers to string literals

2020-02-13 Thread Andy Lester
Change by Andy Lester : -- keywords: +patch pull_requests: +17886 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18510 ___ Python tracker <https://bugs.python.org/issu

[issue39573] Make PyObject an opaque structure in the limited C API

2020-02-15 Thread Andy Lester
Andy Lester added the comment: @vstinner would it be helpful if I went on a sweep looking for places we can use the new Py_IS_TYPE macro? Getting away from Py_TYPE(op) would also mean a move to making the internals const-correct. -- nosy: +petdance

  1   2   3   4   >