[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: -Python 3.4

[issue23500] Argument Clinic: multiple macro definition

2015-04-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Larry. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue23500] Argument Clinic: multiple macro definition

2015-04-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think this is not needed. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[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 ___ ___ Python-bugs-list mailing list

[issue23500] Argument Clinic: multiple macro definition

2015-04-03 Thread Roundup Robot
Roundup Robot added the comment: New changeset 25eef0ecb9c1 by Larry Hastings in branch 'default': Issue #23500: Argument Clinic is now smarter about generating the "#ifndef" https://hg.python.org/cpython/rev/25eef0ecb9c1 -- nosy: +python-dev ___ Pyth

[issue23500] Argument Clinic: multiple macro definition

2015-04-03 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> larry stage: patch review -> commit review ___ Python tracker ___ ___ Python-bugs-list

[issue23500] Argument Clinic: multiple macro definition

2015-04-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: larry.ac_multiple_macro_definitions.diff.5.txt LGTM. -- ___ Python tracker ___ ___ Python-bugs-lis

[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 the patch, so

[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 ___ ___ Python-bugs-list mail

[issue23500] Argument Clinic: multiple macro definition

2015-04-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Looks as you didn't notice my comments on Rietveld. -- ___ Python tracker ___ ___ Python-bugs-list

[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 myself a littl

[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 ___ ___ Pyth

[issue23500] Argument Clinic: multiple macro definition

2015-03-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you please commit your patch (may be with changes) Larry? -- ___ Python tracker ___ ___ Pyth

[issue23500] Argument Clinic: multiple macro definition

2015-03-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This looks as generalization of my patch. It produces the same output. I left comments on Rietveld, but in any case the patch LGTM. -- ___ Python tracker ___

[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 joined together, like

[issue23500] Argument Clinic: multiple macro definition

2015-03-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, this works. Here is combined patch and proceeded sample file. -- Added file: http://bugs.python.org/file38494/clinic_append_2.patch Added file: http://bugs.python.org/file38495/sample.c ___ Python tracker

[issue23500] Argument Clinic: multiple macro definition

2015-03-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It doesn't fix the issue, because the #ifndef stanza is emitted before second definition. Try to run clinic.py with your patch on sample.c. But may be this idea can be used with my patch. -- ___ Python tracker

[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 ___ Python tracker

[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

[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 ___ ___ Pyth

[issue23500] Argument Clinic: multiple macro definition

2015-03-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: May be first commit this non-perfect solution? Generated code is correct, it is just not optimal. This issue is a dependency of issue23501, that is a dependency of issue23492, that is a dependency of my patch for optimizing argument parsing in 1-argument fun

[issue23500] Argument Clinic: multiple macro definition

2015-03-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Actually in this sample output no one #ifndef SPAM_METHODDEF stanza is needed, because SPAM_METHODDEF is defined in any case. -- ___ Python tracker _

[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. -- ___ Python

[issue23500] Argument Clinic: multiple macro definition

2015-03-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a sample file generated by fixed clinic.py. -- Added file: http://bugs.python.org/file38329/sample.c ___ Python tracker ___ __

[issue23500] Argument Clinic: multiple macro definition

2015-03-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch which moves all methoddef_ifndef to the end of the buffer or file, so they are not conflicts with other definitions. -- keywords: +needs review, patch stage: -> patch review Added file: http://bugs.python.org/file38328/clinic_append.p

[issue23500] Argument Clinic: multiple macro definition

2015-02-25 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +Argument Clinic ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue23500] Argument Clinic: multiple macro definition

2015-02-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oh, sorry. Here is a sample. Other sample see in issue23501. -- Added file: http://bugs.python.org/file38205/sample.c ___ Python tracker ___ _

[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 ___ ___ Python-bugs-list mailing list Unsubscribe

[issue23500] Argument Clinic: multiple macro definition

2015-02-22 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +larry ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue23500] Argument Clinic: multiple macro definition

2015-02-22 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Argument Clinic generates multiple definitions in non-block mode for functions with alternating signature. See example file. If FOO is not defines, SPAM_METHODDEF is defined twice. First time in: #ifndef SPAM_METHODDEF #define SPAM_METHODDEF #endif /*