[issue26774] Elide Py_atomic fences when WITH_THREAD is disabled?

2016-04-15 Thread Larry Hastings
New submission from Larry Hastings: Right now the atomic access fence macros in pyatomic.h are unconditional. This means that they're active even even when you "./configure --without-threads". If Python thread support is disabled, surely we don't need to ensure atomic

[issue26753] Obmalloc lock LOCK_INIT and LOCK_FINI are never used

2016-04-16 Thread Larry Hastings
Larry Hastings added the comment: Patch attached. The basics were okay; however, there was no locking around access to a static variable (_Py_AllocatedBlocks) so I added some. The way the code managed _Py_AllocatedBlocks was a bit odd; this approach resulted in fewer lines, but it was hard

[issue26753] Obmalloc lock LOCK_INIT and LOCK_FINI are never used

2016-04-16 Thread Larry Hastings
Larry Hastings added the comment: Oy veh, in editing the issue I dropped the attached file. Here it is. -- keywords: +patch Added file: http://bugs.python.org/file42479/larry.refresh.lock.macros.for.obmalloc.diff ___ Python tracker <h

[issue26814] Add a new _PyObject_CallStack() function which avoids the creation of a tuple or dict for arguments

2016-04-21 Thread Larry Hastings
Larry Hastings added the comment: Yes, I've been working on a patch to do this as well. I called the calling convention METH_RAW, to go alongside METH_ZERO METH_O etc. My calling convention was exactly the same as yours: PyObject *(PyObject *o, PyObject **stack, int na, int nk). I onl

[issue26800] Don't accept bytearray as filenames part 2

2016-04-21 Thread Larry Hastings
Larry Hastings added the comment: I did the path_converter change. IIRC some functions supported bytearray, some did not, and in my quest for consistency I took the superset of functionality and supported bytearray for everything. Sounds to me like bytearray support should be dropped, but

[issue26825] Variable defined in exec(code) unreachable inside function call with visible name in dir() results

2016-04-22 Thread Larry Hastings
Changes by Larry Hastings : -- nosy: -larry ___ Python tracker <http://bugs.python.org/issue26825> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue26891] CPython doesn't work when you disable refcounting

2016-04-29 Thread Larry Hastings
New submission from Larry Hastings: So here's a strange one. I want to do some mysterious experiments with CPython. So I disabled refcount changes in CPython. I changed Py_INCR and Py_DECR so they expand to nothing. I had to change some other macros to match (SETREF, XSETREF, an

[issue26891] CPython doesn't work when you disable refcounting

2016-04-29 Thread Larry Hastings
Changes by Larry Hastings : -- versions: +Python 3.6 ___ Python tracker <http://bugs.python.org/issue26891> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue26891] CPython doesn't work when you disable refcounting

2016-04-30 Thread Larry Hastings
Larry Hastings added the comment: I did as you suggested. I also discovered that _Py_NewReference is usually a macro, and I'd only fixed the version in Objects/object.c (the one not being used). When I fixed both those things, and switched the makefile so it uses a different P

[issue26891] CPython doesn't work when you disable refcounting

2016-04-30 Thread Larry Hastings
Larry Hastings added the comment: Here is my theory: if the code asserts that it's true, and the code normally runs fine, then it's normally true, and therefore I can remove the assertion and the code will run correctly. I haven't hit that assertion in the peephole optimiz

[issue26901] Argument Clinic test is broken

2016-05-01 Thread Larry Hastings
Larry Hastings added the comment: I will admit that even during development I rarely used Clinic's test suite. My test suite is: make a change, then run Clinic over all of CPython and do a diff. If nothing changed then Clinic is still wo

[issue26902] Argument Clinic incorrectly works with custom converter and renamed parameter

2016-05-01 Thread Larry Hastings
Larry Hastings added the comment: This is caused by your "meth_o inline" code, which isn't checked in yet. A clean checkout of CPython trunk generates this correct code: if (!PyArg_Parse(arg, "O&:test", PyUnicode_FSConverter, &path)) Maybe you don'

[issue26305] Make Argument Clinic to generate PEP 7 conforming code

2016-05-01 Thread Larry Hastings
Larry Hastings added the comment: I'm not excited by this new addition to PEP 7, so I'm excusing myself from this issue. -- ___ Python tracker <http://bugs.python.o

[issue23867] Argument Clinic: inline parsing code for 1-argument functions

2016-05-01 Thread Larry Hastings
Larry Hastings added the comment: Why is this dependent on #26305? -- ___ Python tracker <http://bugs.python.org/issue23867> ___ ___ Python-bugs-list mailin

[issue26905] from multiprocessing.pool import Pool bug on linux

2016-05-02 Thread Larry Hastings
Larry Hastings added the comment: This has nothing to do with Argument Clinic, which is an internal tool used in the Python 3.x series. -- components: -Argument Clinic nosy: -859911096 ___ Python tracker <http://bugs.python.org/issue26

[issue16113] Add SHA-3 and SHAKE (Keccak) support

2016-05-07 Thread Larry Hastings
Larry Hastings added the comment: Christian: any interest in proposing this for 2.7? We could ask Benjamin. It could still make 2.7.11--rc1 should be tagged in about a month. -- ___ Python tracker <http://bugs.python.org/issue16

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2016-05-15 Thread Larry Hastings
Larry Hastings added the comment: Summary: read Matt's original message on the bug. Status: still broken. Some people think it should be left that way. Proposed fix: it's straightforward to fix. You wrote a patch, I modified yours a little. The patch is short and ea

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2016-05-15 Thread Larry Hastings
Larry Hastings added the comment: Updated patch based on feedback from Serihy. Thanks for the ping. -- Added file: http://bugs.python.org/file42860/larry.make.file_read.use.size_t.2.diff ___ Python tracker <http://bugs.python.org/issue21

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2016-05-15 Thread Larry Hastings
Larry Hastings added the comment: Martin said: > Josh: it's not as simple as just changing the type code and variable type. > Systems used to require all kinds of types in the length parameter of read(2) > and fread(3), including int, long, and size_t. If it was int, passing s

[issue23500] Argument Clinic: multiple macro definition

2015-02-22 Thread Larry Hastings
Larry Hastings added the comment: Can you give me a test case? -- ___ Python tracker <http://bugs.python.org/issue23500> ___ ___ Python-bugs-list mailin

[issue20323] Argument Clinic: docstring_prototype output causes build failure on Windows

2015-02-25 Thread Larry Hastings
Larry Hastings added the comment: Perhaps, now that Guido allows us to redirect into a separate file, we should simply abandon the two-pass approach. -- ___ Python tracker <http://bugs.python.org/issue20

[issue19075] Add sorting algorithm visualization to turtledemo

2015-02-27 Thread Larry Hastings
Larry Hastings added the comment: This can wait for 3.5. -- ___ Python tracker <http://bugs.python.org/issue19075> ___ ___ Python-bugs-list mailing list Unsub

[issue23471] 404 Not Found when downloading Python 3.4.3rc1 Documentation

2015-02-27 Thread Larry Hastings
Larry Hastings added the comment: This is part of the release process. 3.4.3 was fine last I checked, so perhaps some wonderful automated process broke it for me. 3.5, I think I simply didn't upload the docs properly. Anyway, this is my responsibility as RM for 3.4 and 3.5, so in the f

[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-02-27 Thread Larry Hastings
Larry Hastings added the comment: I turned in my Windows developer badge in 2007. Can I recuse myself, pretty-please? How about Tim Golden or Zach Ware? Who I notice are conveniently already added to the nosy list! -- ___ Python tracker <h

[issue23471] 404 Not Found when downloading Python 3.4.3rc1 Documentation

2015-02-27 Thread Larry Hastings
Larry Hastings added the comment: I think I've got them all working now. Please reopen if you discover new breakage. (Or old breakage I guess if I didn't actually fix it...!) -- resolution: -> fixed stage: -> resolved status

[issue21293] Remove "capsule hack" from object.c?

2015-03-02 Thread Larry Hastings
Larry Hastings added the comment: You give me too much credit. I'm the chimp who put it there in the first place. Though, admittedly, it was a copy&paste job based on the ancient CObject. My guess is this was very helpful in 1.4, or

[issue21293] Remove "capsule hack" from object.c?

2015-03-02 Thread Larry Hastings
Larry Hastings added the comment: Yeah, I went ahead and checked this in. I'm living life on the *edge*. To the EXTREME! -- assignee: -> larry resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Pyth

[issue23500] Argument Clinic: multiple macro definition

2015-03-04 Thread Larry Hastings
Larry Hastings added the comment: In your sample output we still get two #ifndef SPAM_METHODDEF stanzas. Wouldn't it be better to only have one? Maybe Clinic needs to be smarter about generating those anyway. Let me think about it. -- ___ P

[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-03-04 Thread Larry Hastings
Larry Hastings added the comment: I can live with that, if you're confident in it and you'll watch the buildbots. -- ___ Python tracker <http://bugs.python.o

[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-03-06 Thread Larry Hastings
Larry Hastings added the comment: FWIW I'm tagging alpha 2 somewhere around 24-36 hours from now. -- ___ Python tracker <http://bugs.python.org/is

[issue23415] add-to-pydotorg does not support .exe installers for Windows

2015-03-09 Thread Larry Hastings
Larry Hastings added the comment: Using it with 3.5.0a2, it still printed the "could not be processed" error message, but there's a new wrinkle: the one executable it processed, it added incorrectly. The "-amd64-webinstall" exe was identified as "Win

[issue23619] Python 3.5.0a2 installer fails on Windows

2015-03-09 Thread Larry Hastings
Larry Hastings added the comment: Yup. -- ___ Python tracker <http://bugs.python.org/issue23619> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23619] Python 3.5.0a2 installer fails on Windows

2015-03-09 Thread Larry Hastings
Larry Hastings added the comment: > Any idea how long until the CDN picks up the update? curl -X PURGE https://www.python.org/ftp/python/2.7.5/Python-2.7.5.tar.xz will explicitly tell the CDN to pick up the new binaries. Not sure if that works from anywhere or just from dl-files.iad1.psf

[issue23619] Python 3.5.0a2 installer fails on Windows

2015-03-09 Thread Larry Hastings
Larry Hastings added the comment: Okay, I refreshed the MD5 sums and sizes on the web site, and purged the old files from the CDN. -- ___ Python tracker <http://bugs.python.org/issue23

[issue23486] Enum member lookup is 20x slower than normal class attribute lookup

2015-03-10 Thread Larry Hastings
Larry Hastings added the comment: My inclination is 3.5 only. Barry, do you want to argue for this going into 3.4? -- ___ Python tracker <http://bugs.python.org/issue23

[issue23486] Enum member lookup is 20x slower than normal class attribute lookup

2015-03-11 Thread Larry Hastings
Larry Hastings added the comment: Oh, I read the code. But it's a performance hack, and the rules say we only accept security fixes and bug fixes at this stage of the release, and they're the rules for good reasons. -- ___ Python trac

[issue23500] Argument Clinic: multiple macro definition

2015-03-14 Thread Larry Hastings
Larry Hastings added the comment: How about this approach? Only ever emit the #ifndef stanza once per symbol. -- Added file: http://bugs.python.org/file38491/larry.ac_multiple_macro_definitions.diff.1.txt ___ Python tracker <http://bugs.python.

[issue23500] Argument Clinic: multiple macro definition

2015-03-14 Thread Larry Hastings
Larry Hastings added the comment: (see larry.ac_multiple_macro_definitions.diff.1.txt posted above) -- ___ Python tracker <http://bugs.python.org/issue23

[issue23500] Argument Clinic: multiple macro definition

2015-03-14 Thread Larry Hastings
Larry Hastings added the comment: Oops, I should have run "make clinic", so you could see all the changes that result from this patch. -- Added file: http://bugs.python.org/file38492/larry.ac_multiple_macro_definitions.diff.2.txt ___ Pyth

[issue23500] Argument Clinic: multiple macro definition

2015-03-18 Thread Larry Hastings
Larry Hastings added the comment: What do you think of this approach? Now a "Destination" object behaves like an array of text accumulators. If you ask for one that doesn't exist it's created for you. When the Destination is dumped, the output from each accumulator is j

[issue20181] Derby #12: Convert 50 sites to Argument Clinic across 4 files

2015-03-25 Thread Larry Hastings
Larry Hastings added the comment: I read it quickly. It looks basically okay, but I have one issue to discuss right now. Changing from the format unit 'O!' and calling "getuchar" to the format unit 'C' means a change in semantics. The text in the exceptio

[issue23500] Argument Clinic: multiple macro definition

2015-03-30 Thread Larry Hastings
Larry Hastings added the comment: I want to redo it--it's smelly. I hope to get it done this week. -- ___ Python tracker <http://bugs.python.org/is

[issue23500] Argument Clinic: multiple macro definition

2015-04-03 Thread Larry Hastings
Larry Hastings added the comment: As promised, here's a cleaned-up version of the patch. The taxonomy of objects now makes sense: a Destination contains a BufferSeries object, rather than Destinations weirdly supporting __getitem__ to reference different objects. I tripped over mys

[issue23500] Argument Clinic: multiple macro definition

2015-04-03 Thread Larry Hastings
Larry Hastings added the comment: I did, I just didn't respond. I'll do that now. -- ___ Python tracker <http://bugs.python.org/issue23500> ___ ___

[issue23500] Argument Clinic: multiple macro definition

2015-04-03 Thread Larry Hastings
Larry Hastings added the comment: Updated patch, removed all references to two-pass. Also realized I needed to make the default behavior for methoddef_ifndef go to the end. And, finally, I forgot to merge the "only print each #ifndef block once" code I wrote before when I redid

[issue23500] Argument Clinic: multiple macro definition

2015-04-03 Thread Larry Hastings
Larry Hastings added the comment: Does this really need a backport to 3.4? -- ___ Python tracker <http://bugs.python.org/issue23500> ___ ___ Python-bugs-list m

[issue23500] Argument Clinic: multiple macro definition

2015-04-03 Thread Larry Hastings
Larry Hastings added the comment: Removing 3.4 from the version list as I close the bug, then. If we decide we need it backported please reopen (or create a new bug, either is fine). -- resolution: -> fixed stage: commit review -> resolved status: open -> closed versions:

[issue23501] Argument Clinic: generate code into separate files by default

2015-04-03 Thread Larry Hastings
Larry Hastings added the comment: Thanks! I've been meaning to follow up on this. I think CPython should be consistent, one way or another. So I support this change. -- ___ Python tracker <http://bugs.python.org/is

[issue23920] Should Clinic have "nullable" or types=NoneType?

2015-04-11 Thread Larry Hastings
New submission from Larry Hastings: I was staring at Clinic tonight and a thought came to me. We could express "nullable=True" as "types='NoneType'". For example, the converter for 'Z' could change from Py_UNICODE(nullable=True) to Py_UNICOD

[issue23920] Should Clinic have "nullable" or types=NoneType?

2015-04-12 Thread Larry Hastings
Larry Hastings added the comment: Saying that "str" is redundant makes me think you don't understand what "types" does. "types" accepts a text string listing all of the Python types the converter accepts. You can accept the converter's default, or

[issue23926] skipitem() in getargs.c still supports 'w' and 'w#', and shouldn't

2015-04-12 Thread Larry Hastings
New submission from Larry Hastings: tl;dr: skipitem() in Python 3 still supports "w" and "w#", which were abandoned. They should be removed. -- If: * you have an extension that parses its arguments with PyArg_ParseTupleAndKeywords (or its cousins), * you have

[issue23927] getargs.c skipitem() doesn't skip 'w*'

2015-04-12 Thread Larry Hastings
New submission from Larry Hastings: tl;dr: skipitem() in Python/getsargs.c doesn't know about the 'w*' format unit, which could lead to a crash. It should know about it. -- If: * you have an extension that parses its arguments with PyArg_ParseTupleAndKeywords (or its cousi

[issue23934] inspect.signature reporting "()" for all builtin & extension types

2015-04-13 Thread Larry Hastings
Larry Hastings added the comment: Would this qualify as an "easy" bug we could throw to a sprinter? -- ___ Python tracker <http://bugs.python.o

[issue20181] Derby #12: Convert 50 sites to Argument Clinic across 4 files

2015-04-13 Thread Larry Hastings
Larry Hastings added the comment: I finally talked to someone (Thomas Wouters) about this. For something going into trunk that will be part of 3.5, this is fine. Please include a mention that the exception's text messages changed in Misc/NEWS. I can help you write this if you want.

[issue23935] Clean up Clinic's type expressions of buffers

2015-04-13 Thread Larry Hastings
New submission from Larry Hastings: Clinic was previously pretty confused about what things accepted "bytes", "bytearray", "buffer", "robuffer", and "rwbuffer". This is because the documentation itself was somewhat confusing. The docum

[issue23935] Clean up Clinic's type expressions of buffers

2015-04-13 Thread Larry Hastings
Larry Hastings added the comment: Huh. Why didn't it attach my patch? Here it is. -- Added file: http://bugs.python.org/file38933/larry.clinic.buffer.conceptual.cleanup.1.txt ___ Python tracker <http://bugs.python.org/is

[issue22631] Feature Request CAN_RAW_FD_FRAMES

2015-04-13 Thread Larry Hastings
Larry Hastings added the comment: LGTM, just adding Antoine (the expert for the socket module). I'm ready to commit over here. -- nosy: +pitrou ___ Python tracker <http://bugs.python.org/is

[issue23935] Clean up Clinic's type expressions of buffers

2015-04-13 Thread Larry Hastings
Larry Hastings added the comment: Updated the patch a little, to make it enforce compatible "types" parameters. The previous patch had some functions that would permit passing in "types='blah de blah'" or other nonsense. -- Added file: ht

[issue22631] Feature Request CAN_RAW_FD_FRAMES

2015-04-13 Thread Larry Hastings
Larry Hastings added the comment: Follow the instructions in this: https://docs.python.org/devguide/docquality.html And make it look something like this: https://docs.python.org/3/library/socket.html#socket.CAN_BCM -- ___ Python tracker <h

[issue22631] Feature Request CAN_RAW_FD_FRAMES

2015-04-13 Thread Larry Hastings
Larry Hastings added the comment: Patch committed. Thanks, Joe! -- assignee: -> larry resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker <http://bugs.python

[issue20586] Argument Clinic: functions with valid sig but no docstring have no __text_signature__

2015-04-13 Thread Larry Hastings
Larry Hastings added the comment: LGTM -- assignee: -> zach.ware ___ Python tracker <http://bugs.python.org/issue20586> ___ ___ Python-bugs-list mai

[issue23944] Argument Clinic: wrap impl's declaration if it's too long

2015-04-13 Thread Larry Hastings
Larry Hastings added the comment: If you give me a test case I'll knock this out. -- ___ Python tracker <http://bugs.python.org/issue23944> ___ ___ Pytho

[issue22631] Feature Request CAN_RAW_FD_FRAMES

2015-04-14 Thread Larry Hastings
Larry Hastings added the comment: Isn't this a "new feature"? 2.7 is maybe fair game, but 3.4 arguably is not. It should be odd to have a field marked in the documentation as "New in 3.4.4." -- ___ Python tracker <http:

[issue22631] Feature Request CAN_RAW_FD_FRAMES

2015-04-14 Thread Larry Hastings
Larry Hastings added the comment: Benjamin, would you like CAN_RAW_FD_FRAMES in the next 2.7? -- nosy: +benjamin.peterson ___ Python tracker <http://bugs.python.org/issue22

[issue23953] test_mmap uses cruel and unusual amounts of disk space

2015-04-14 Thread Larry Hastings
New submission from Larry Hastings: My laptop is running 64-bit Linux (14.10). It has 4.6GB of free disk space. Naturally that's not enough to run test_mmap. When I run the test suite, test_mmap consumes all available disk space, then fails. (Hopefully freeing all its temporary files!

[issue23935] Clean up Clinic's type expressions of buffers

2015-04-14 Thread Larry Hastings
Larry Hastings added the comment: New patch revision, including the new API change (the "types" argument to a constructor must now be a set of strings). -- Added file: http://bugs.python.org/file39001/larry.clinic.buffer.conceptual.cle

[issue23944] Argument Clinic: wrap impl's declaration if it's too long

2015-04-14 Thread Larry Hastings
Larry Hastings added the comment: I wish the Python bug tracker had a way of attaching files to issues, so we didn't have to just copy and paste into and out of the comments. Ah well, wishful thinking! -- ___ Python tracker

[issue23944] Argument Clinic: wrap impl's declaration if it's too long

2015-04-14 Thread Larry Hastings
Larry Hastings added the comment: That's AMAZING, you mean the web site knew how to do that THE WHOLE TIME? -- ___ Python tracker <http://bugs.python.org/is

[issue23944] Argument Clinic: wrap impl's declaration if it's too long

2015-04-14 Thread Larry Hastings
Larry Hastings added the comment: Attached is a patch. This causes a lot of churn, darn. Should I copy & paste the patch into this text box too? Maybe that would be more convenient! -- Added file: http://bugs.python.org/file39008/larry.clinic.wrap.long.impl.decls.1

[issue23944] Argument Clinic: wrap impl's declaration if it's too long

2015-04-14 Thread Larry Hastings
Larry Hastings added the comment: Okay, this patch is about half the size. I had a bug that was throwing away some important syntax. With this patch applied, Python builds and the test suite is as reasonable as usual. I swear, C compilers are so fussy sometimes! -- Added file

[issue23944] Argument Clinic: wrap impl's declaration if it's too long

2015-04-14 Thread Larry Hastings
Changes by Larry Hastings : -- assignee: -> larry resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker <http://bugs.python

[issue23953] test_mmap uses cruel and unusual amounts of disk space

2015-04-14 Thread Larry Hastings
Larry Hastings added the comment: ZFS. -- ___ Python tracker <http://bugs.python.org/issue23953> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23953] test_mmap uses cruel and unusual amounts of disk space

2015-04-14 Thread Larry Hastings
Larry Hastings added the comment: Wall time was 3 minutes 38 seconds. % time ./python -m test test_mmap [1/1] test_mmap test test_mmap failed -- multiple errors occurred; run in verbose mode for details 1 test failed: test_mmap ./python -m test test_mmap 0.40s user 22.41s system 10% cpu 3

[issue23935] Clean up Clinic's type expressions of buffers

2015-04-14 Thread Larry Hastings
Larry Hastings added the comment: In the case of namedtuple and Enum, the parameter represents a sequence of strings--order is significant. With the 'types' parameter for converters, the internal model was always meant to be a *set* of strings. The order was explicitly *not* s

[issue23935] Clean up Clinic's type expressions of buffers

2015-04-14 Thread Larry Hastings
Larry Hastings added the comment: Latest patch, with another round of lovely comments from Serhiy. -- Added file: http://bugs.python.org/file39030/larry.clinic.buffer.conceptual.cleanup.4.txt ___ Python tracker <http://bugs.python.org/issue23

[issue20172] Derby #3: Convert 67 sites to Argument Clinic across 4 files (Windows)

2015-04-15 Thread Larry Hastings
Larry Hastings added the comment: If * the diff looks clean * it compiles without any *new* (sigh) errors, and * it passes the unit test suite without any *new* (sigh) failures, then the Clinic conversion can generally be considered a success

[issue23967] Make inspect.signature expression evaluation more powerful

2015-04-15 Thread Larry Hastings
New submission from Larry Hastings: Peter's working on converting socket to use Argument Clinic. He had a default that really should look like this: min(SOME_SOCKET_MODULE_CONSTANT, 128) "min" wasn't something we'd needed before. I thought about it and rea

[issue23971] dict(list) and dict.fromkeys() doesn't account for 2/3 fill ratio

2015-04-15 Thread Larry Hastings
New submission from Larry Hastings: Matt Mackall brought this over to me today. If list "l" has one million pairs and you do dict(l) it creates the dict, then resizes it to a million elements, then starts adding name/value pairs. But since it's sized to a million elements,

[issue23935] Clean up Clinic's type expressions of buffers

2015-04-15 Thread Larry Hastings
Larry Hastings added the comment: While cleaning this up I noticed that es# and et# should both require "nullable". Fixed that too. I sure hope it's all correct now! -- resolution: -> fixed stage: patch review -> resolved s

[issue23980] Documentation for format units starting with 'e' is inconsistent

2015-04-16 Thread Larry Hastings
New submission from Larry Hastings: Documentation is here: https://docs.python.org/3/c-api/arg.html#arg-parsing The first line of documentation for each format unit follows this convention: formatunit (pythontype) [arguments, to, pyarg_parsetuple] These represent the format unit

[issue23980] Documentation for format units starting with 'e' is inconsistent

2015-04-16 Thread Larry Hastings
Larry Hastings added the comment: > The "e" variants (typically) allocate a buffer for you, since it's pretty > much unknown how long the encoded data will be. All four will do it if you pass in a NULL pointer. "es#" and "et#" can reuse an existing buff

[issue23980] Documentation for format units starting with 'e' is inconsistent

2015-04-16 Thread Larry Hastings
Larry Hastings added the comment: One more idea. We annotate with an & when you pass in a pointer to a variable. So format unit 'i' would get [& int], 's' would get [& char *], and 'es#' would get [char *, & char *, & int]. --

[issue24000] More fixes for the Clinic mapping of converters to format units

2015-04-18 Thread Larry Hastings
New submission from Larry Hastings: I found another bug in the mapping of converters to format units. (s#, z#, and y# all allow zeroes.) I've redone the approach for str_converter in an attempt to make it easier to read. It'd be swell if, after this gets checked in (or rejected)

[issue24001] Clinic: use raw types in types= set

2015-04-18 Thread Larry Hastings
New submission from Larry Hastings: New proposed semantics for the types= parameter to converters: where possible, pass in actual types. The resulting syntax: c: int(types={str}) # maps to 'U' s: str(types={str, robuffer}, length=True, zeroes=True) # maps to 's#&

[issue23920] Should Clinic have "nullable" or types=NoneType?

2015-04-18 Thread Larry Hastings
Larry Hastings added the comment: I'm now converging on changing types= to accept a set of real types, see issue #24001. That change has an impact on this decision. (By the way, let's assume that if "nullable", I have to rename it to "accepts_none". I'll u

[issue24001] Clinic: use raw types in types= set

2015-04-18 Thread Larry Hastings
Larry Hastings added the comment: Should types= be renamed accept= ? It's a set of the types of the Python objects that this parameter should accept. -- ___ Python tracker <http://bugs.python.org/is

[issue24002] Add un-parse function to ast

2015-04-18 Thread Larry Hastings
New submission from Larry Hastings: Twice recently I've wanted a function that transforms an AST node tree back into text: * In the hacked-up Tools/clinic/clinic.py for issue #24001 * In the hacked-up Lib/inspect.py for issue #23967 Both times I did a half-assed job just to get the

[issue23967] Make inspect.signature expression evaluation more powerful

2015-04-18 Thread Larry Hastings
Larry Hastings added the comment: I should mention that evalify_node() is pretty hacked up here, and is not ready to be checked in. (I'm proposing separately that we simply add something like this directly into the standard library, see issue #

[issue24001] Clinic: use raw types in types= set

2015-04-18 Thread Larry Hastings
Larry Hastings added the comment: I should mention that evalify_node() is pretty hacked up here, and is not ready to be checked in. (I'm proposing separately that we simply add something like this directly into the standard library, see issue #

[issue24002] Add un-parse function to ast

2015-04-18 Thread Larry Hastings
Changes by Larry Hastings : -- nosy: +serhiy.storchaka, zach.ware ___ Python tracker <http://bugs.python.org/issue24002> ___ ___ Python-bugs-list mailin

[issue24002] Add un-parse function to ast

2015-04-18 Thread Larry Hastings
Larry Hastings added the comment: Good idea, I'll go ahead and borrow Guido's time machine. https://docs.python.org/3/library/ast.html#ast.NodeVisitor However, NodeVisitor does not transform the ast tree back into text. So in what way is this helpful? Also, for what it's wor

[issue23920] Should Clinic have "nullable" or types=NoneType?

2015-04-18 Thread Larry Hastings
Larry Hastings added the comment: Oh, I misremembered. The name "allow_none" was inflicted on me by python-dev, in this thread: https://mail.python.org/pipermail/python-dev/2014-August/135650.html -- ___ Python tracker <http://bu

[issue24002] Add un-parse function to ast

2015-04-18 Thread Larry Hastings
Larry Hastings added the comment: Actually eval(ast) is all I need for #23967 too. But eval is a builtin, so it feels wrong to have it supporting--and therefore dependent on--ast. -- ___ Python tracker <http://bugs.python.org/issue24

[issue20180] Derby #11: Convert 50 sites to Argument Clinic across 9 files

2015-04-18 Thread Larry Hastings
Larry Hastings added the comment: Sadly, for political reasons, it's best that we not convert collections, itertools, or random for now. I'll update this issue if the situation changes. Sorry about that! -- ___ Python trac

[issue24000] More fixes for the Clinic mapping of converters to format units

2015-04-19 Thread Larry Hastings
Larry Hastings added the comment: Oh, heavens, yes, that's much nicer. Thanks for the suggestion, Serhiy! -- Added file: http://bugs.python.org/file39115/larry.one.more.clinic.format.unit.map.cleanup.2.txt ___ Python tracker

[issue23920] Should Clinic have "nullable" or types=NoneType?

2015-04-19 Thread Larry Hastings
Larry Hastings added the comment: p.s. I'm now leaning heavily towards renaming "types" to "accept", and putting NoneType in the set passed to accept= instead of a separate parameter. -- ___ Python tracker <http:

[issue23920] Should Clinic have "nullable" or types=NoneType?

2015-04-19 Thread Larry Hastings
Larry Hastings added the comment: I've posted about this to python-dev. -- ___ Python tracker <http://bugs.python.org/issue23920> ___ ___ Python-bugs-list m

[issue24000] More fixes for the Clinic mapping of converters to format units

2015-04-19 Thread Larry Hastings
Larry Hastings added the comment: > Doesn't always zeroes == length? "zeroes" requires "length", but "length" does not require "zeroes". As it happens all the format units supported by str always have both parameters either True or False. B

[issue24002] Add un-parse function to ast

2015-04-19 Thread Larry Hastings
Larry Hastings added the comment: There is! compile() will do it, though the docstring doesn't mention it. (The full documentation does.) The following function meets both my use cases: def eval_ast_expr(node, symbols=None, *, filename='-'): """

[issue24001] Clinic: use raw types in types= set

2015-04-19 Thread Larry Hastings
Larry Hastings added the comment: Thanks to #24002 I now know how to write evalify_node properly. This revision of the patch is much better, and maybe ready for checkin. -- Added file: http://bugs.python.org/file39122/larry.one.more.clinic.format.unit.map.cleanup.2.txt

<    18   19   20   21   22   23   24   >