[issue29328] struct module should support variable-length strings

2021-12-19 Thread Alex Waygood
Alex Waygood added the comment: I am closing this issue as "rejected", given the consensus that writing a patch could be a major undertaking, the lack of such a patch, and the fact that there has been no activity on the issue thread (or the python-ideas mailing list) for nearly 5 years.

[issue29328] struct module should support variable-length strings

2017-01-30 Thread Mark Dickinson
Changes by Mark Dickinson : -- stage: -> needs patch ___ Python tracker ___ ___

[issue29328] struct module should support variable-length strings

2017-01-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: s/Where/Whether/ -- priority: normal -> low ___ Python tracker ___ ___

[issue29328] struct module should support variable-length strings

2017-01-24 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- nosy: +twouters ___ Python tracker ___ ___

[issue29328] struct module should support variable-length strings

2017-01-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, the existence of netstruct https://github.com/stendec/netstruct does at least show that a coherent proposal is possible (the docs provide an API, motivation and examples). One question is whether this could be implemented in the stdlib struct module

[issue29328] struct module should support variable-length strings

2017-01-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If you want to add the support variable-size fields, this is incompatible with the struct module design. If you want to add the support of variable-length strings inside fixed-size fields (as with the 'p' format unit), I think this case is not enough

[issue29328] struct module should support variable-length strings

2017-01-21 Thread Mark Dickinson
Mark Dickinson added the comment: A couple of questions that haven't been brought up yet: 1. Do you have any thoughts on how alignment should behave for '@'-style structs containing variable-length strings? I suspect the easiest solution may be simply to disallow that combination, and only

[issue29328] struct module should support variable-length strings

2017-01-20 Thread Cameron Simpson
Changes by Cameron Simpson : -- nosy: +cameron ___ Python tracker ___ ___ Python-bugs-list

[issue29328] struct module should support variable-length strings

2017-01-20 Thread Elizabeth Myers
Elizabeth Myers added the comment: Also, to add to the discussion: * Rejecting this because "it doesn't cover every use case" is a red herring at best. If this can't cover your use case, odds are the struct module can *never* cover it. That is no reason to reject it alone; you would need

[issue29328] struct module should support variable-length strings

2017-01-20 Thread Elizabeth Myers
Elizabeth Myers added the comment: Hi, After discussing this on the python-ideas ML a bit more, this is actually a feature people want a great deal. It can't cover every use case, but to expand it further than this proposal and make it do so is way beyond the scope of this proposal. It may

[issue29328] struct module should support variable-length strings

2017-01-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: To add a bit to what Yury said, even framing isn't always compatible with this proposal. For example, in dask/distributed, we first have a word for the number of frames, then one word per frame to indicate each frame's length, then the frame bodies.

[issue29328] struct module should support variable-length strings

2017-01-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, I concur with Mark and Yuri that the feature request isn't compatible with the design and purpose of the struct module -- nosy: +rhettinger ___ Python tracker

[issue29328] struct module should support variable-length strings

2017-01-19 Thread Yury Selivanov
Yury Selivanov added the comment: Ethan, thanks for moving my reply on the list to here. Also +1 to what Mark said. -- nosy: +yselivanov ___ Python tracker

[issue29328] struct module should support variable-length strings

2017-01-19 Thread Ethan Furman
Ethan Furman added the comment: >From Yury Selivanov: --- This is a neat idea, but this will only work for parsing framed binary protocols. For example, if you protocol prefixes all packets with a length field, you can write an efficient read buffer and use your proposal to

[issue29328] struct module should support variable-length strings

2017-01-19 Thread Mark Dickinson
Mark Dickinson added the comment: IMO, as one of the previous maintainers of the struct module, this feature request isn't compatible with the current design and purpose of the struct module. I agree that there's an important problem to solve (and one I've had to solve many times for various

[issue29328] struct module should support variable-length strings

2017-01-19 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker ___ ___

[issue29328] struct module should support variable-length strings

2017-01-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you provide some examples of using these format specifiers? I suppose that due to limitations of the struct module the way in which they can be implemented would be not particularly useful for you. -- nosy: +serhiy.storchaka

[issue29328] struct module should support variable-length strings

2017-01-19 Thread Elizabeth Myers
New submission from Elizabeth Myers: There was some discussion on python-ideas about this, and I figured it would be more productive to bring it here since to me this appears to be a glaring omission. The struct module has no capability to support variable-length strings; this includes