[issue210656] IDLE goto file/line (PR#352)

2022-04-10 Thread admin
Change by admin : ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue210656] IDLE goto file/line (PR#352)

2022-04-10 Thread admin
Change by admin : -- github: None -> 32727 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44060] Define TARGET macro the same even when computed goto support is not enabled

2021-05-06 Thread Skip Montanaro
Change by Skip Montanaro : -- keywords: +patch pull_requests: +24612 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25949 ___ Python tracker ___

[issue44060] Define TARGET macro the same even when computed goto support is not enabled

2021-05-06 Thread Skip Montanaro
New submission from Skip Montanaro : When the interpreter is compiled with computed goto support, the TARGET macro is defined like this: #define TARGET(op) op: TARGET_##op If computed gotos are disabled, the implementation is simpler: #define TARGET(op) op I'm finding it useful to use those

[issue43199] FAQ about goto lacks answer

2021-03-14 Thread Terry J. Reedy
Change by Terry J. Reedy : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.6, Python 3.7 ___ Python tracker ___

[issue43199] FAQ about goto lacks answer

2021-03-14 Thread miss-islington
miss-islington added the comment: New changeset 59f2741c4a1a53d4122d2cb512337f4b88619de9 by Miss Islington (bot) in branch '3.8': bpo-43199: Briefly explain why no goto (GH-24852) https://github.com/python/cpython/commit/59f2741c4a1a53d4122d2cb512337f4b88619de9

[issue43199] FAQ about goto lacks answer

2021-03-14 Thread miss-islington
miss-islington added the comment: New changeset c3f0c3a9c7aa213a463c5928d33fd4049060 by Miss Islington (bot) in branch '3.9': bpo-43199: Briefly explain why no goto (GH-24852) https://github.com/python/cpython/commit/c3f0c3a9c7aa213a463c5928d33fd4049060

[issue43199] FAQ about goto lacks answer

2021-03-14 Thread miss-islington
Change by miss-islington : -- pull_requests: +23623 pull_request: https://github.com/python/cpython/pull/24863 ___ Python tracker ___

[issue43199] FAQ about goto lacks answer

2021-03-14 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +23622 pull_request: https://github.com/python/cpython/pull/24862 ___ Python tracker

[issue43199] FAQ about goto lacks answer

2021-03-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset 5e29021a5eb10baa9147fd977cab82fa3f652bf0 by Terry Jan Reedy in branch 'master': bpo-43199: Briefly explain why no goto (GH-24852) https://github.com/python/cpython/commit/5e29021a5eb10baa9147fd977cab82fa3f652bf0

[issue43199] FAQ about goto lacks answer

2021-03-13 Thread Terry J. Reedy
Change by Terry J. Reedy : -- keywords: +patch nosy: +terry.reedy nosy_count: 2.0 -> 3.0 pull_requests: +23613 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24852 ___ Python tracker

[issue43199] FAQ about goto lacks answer

2021-02-11 Thread Mikael Lövqvist
New submission from Mikael Lövqvist : In the FAQ there is a question "Why is there no goto?" but the answer addresses how to use exceptions to do something akin to goto. I think the documentation could benefit from the reasons why there is no goto or that the question is changed, pe

[issue42144] A missing "goto" in the _ssl module!

2020-10-25 Thread Christian Heimes
Christian Heimes added the comment: Thanks, excellent finding. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior ___ Python tracker

[issue42144] A missing "goto" in the _ssl module!

2020-10-25 Thread miss-islington
miss-islington added the comment: New changeset 83c86cf54b36a7325f615f5adf22b28e48f0e72d by Miss Skeleton (bot) in branch '3.9': bpo-42144: Add a missing "goto error;" in the _ssl module (GH-22959) https://github.com/python/cpython/commit/83c86cf54b36a7325f615f5adf22b2

[issue42144] A missing "goto" in the _ssl module!

2020-10-25 Thread miss-islington
miss-islington added the comment: New changeset 8e980ecfb7b42063ed41d665288aff69f0ed7fdc by Miss Skeleton (bot) in branch '3.8': bpo-42144: Add a missing "goto error;" in the _ssl module (GH-22959) https://github.com/python/cpython/commit/8e980ecfb7b42063ed41d665288aff

[issue42144] A missing "goto" in the _ssl module!

2020-10-25 Thread miss-islington
miss-islington added the comment: New changeset c32f2976b8f4034724c3270397aa16f38daf470f by Zackery Spytz in branch 'master': bpo-42144: Add a missing "goto error;" in the _ssl module (GH-22959) https://github.com/python/cpython/commit/c32f2976b8f4034724c3270397aa16

[issue42144] A missing "goto" in the _ssl module!

2020-10-25 Thread miss-islington
Change by miss-islington : -- pull_requests: +21892 pull_request: https://github.com/python/cpython/pull/22975 ___ Python tracker ___

[issue42144] A missing "goto" in the _ssl module!

2020-10-25 Thread miss-islington
Change by miss-islington : -- pull_requests: +21891 pull_request: https://github.com/python/cpython/pull/22974 ___ Python tracker ___

[issue42144] A missing "goto" in the _ssl module!

2020-10-24 Thread Zackery Spytz
Change by Zackery Spytz : -- keywords: +patch pull_requests: +21876 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22959 ___ Python tracker ___

[issue42144] A missing "goto" in the _ssl module!

2020-10-24 Thread Zackery Spytz
New submission from Zackery Spytz : In the _ssl_configure_hostname() function, there's a missing "goto error;" if SSL_set_tlsext_host_name() fails. -- assignee: christian.heimes components: Extension Modules, SSL messages: 379562 nosy: ZackerySpytz, christian.heimes priori

[issue27115] IDLE goto should use query.Query subclass

2020-03-09 Thread Terry J. Reedy
Change by Terry J. Reedy : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue27115] IDLE goto should use query.Query subclass

2020-03-09 Thread miss-islington
miss-islington added the comment: New changeset f8345358bcdd276eb470778daf05d343da9f1290 by Miss Islington (bot) in branch '3.7': bpo-27115: Use Query subclass for IDLE editor Goto (GH-18871) https://github.com/python/cpython/commit/f8345358bcdd276eb470778daf05d343da9f1290

[issue27115] IDLE goto should use query.Query subclass

2020-03-09 Thread miss-islington
miss-islington added the comment: New changeset cadfe52a006abb46ea0948c6ae2e006064b4a091 by Miss Islington (bot) in branch '3.8': bpo-27115: Use Query subclass for IDLE editor Goto (GH-18871) https://github.com/python/cpython/commit/cadfe52a006abb46ea0948c6ae2e006064b4a091

[issue27115] IDLE goto should use query.Query subclass

2020-03-09 Thread miss-islington
Change by miss-islington : -- pull_requests: +18243 pull_request: https://github.com/python/cpython/pull/18886 ___ Python tracker ___

[issue27115] IDLE goto should use query.Query subclass

2020-03-09 Thread miss-islington
Change by miss-islington : -- pull_requests: +18244 pull_request: https://github.com/python/cpython/pull/18887 ___ Python tracker ___

[issue27115] IDLE goto should use query.Query subclass

2020-03-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset 363fab83b8a0e6d924c7a7c577feec6a2812bb8c by Terry Jan Reedy in branch 'master': bpo-27115: Use Query subclass for IDLE editor Goto (GH-18871) https://github.com/python/cpython/commit/363fab83b8a0e6d924c7a7c577feec6a2812bb8c

[issue39852] IDLE: Goto should remove selection and update the status bar

2020-03-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: https://github.com/python/devguide/issues/577 -- ___ Python tracker ___ ___ Python-bugs-list

[issue39852] IDLE: Goto should remove selection and update the status bar

2020-03-09 Thread Guido van Rossum
Guido van Rossum added the comment: I guess it's similar to the 'return' vs. 'returns' issue, but I feel much stronger about it here. I would have written that as "make the spam module more spammy". Just read a bunch of commits using e.g. `git log --oneline` to see what the prevailing style

[issue27115] IDLE goto should use query.Query subclass

2020-03-09 Thread Terry J. Reedy
Change by Terry J. Reedy : -- pull_requests: +18229 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/18871 ___ Python tracker ___

[issue27115] IDLE goto should use query.Query subclass

2020-03-09 Thread Terry J. Reedy
Change by Terry J. Reedy : -- dependencies: -Finish IDLE Query dialog appearance and behavior. stage: patch review -> test needed ___ Python tracker ___

[issue39852] IDLE: Goto should remove selection and update the status bar

2020-03-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: Is it the temporal ambiguity (fixed by adding 'now', which is in the blurbs) or the descriptive versus command style (as with 'Returns' versus 'Return') that you do not like? If the latter, the devguide could use augmentation. The only relevant 'guidance'

[issue27115] IDLE goto should use query.Query subclass

2020-03-08 Thread miss-islington
miss-islington added the comment: New changeset f3f0c7a108cd2a5071592e77e2f4b14ca35d4fcc by Miss Islington (bot) in branch '3.8': bpo-27115: Move IDLE Query error blanking (GH-18868) https://github.com/python/cpython/commit/f3f0c7a108cd2a5071592e77e2f4b14ca35d4fcc --

[issue27115] IDLE goto should use query.Query subclass

2020-03-08 Thread miss-islington
miss-islington added the comment: New changeset 9d5ed8355d4cb73ab13fa6094c9ab57798dff3be by Miss Islington (bot) in branch '3.7': bpo-27115: Move IDLE Query error blanking (GH-18868) https://github.com/python/cpython/commit/9d5ed8355d4cb73ab13fa6094c9ab57798dff3be --

[issue27115] IDLE goto should use query.Query subclass

2020-03-08 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +18227 pull_request: https://github.com/python/cpython/pull/18869 ___ Python tracker

[issue27115] IDLE goto should use query.Query subclass

2020-03-08 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset e53a3932cb01683b0fa8a7448ca25a2e658c39e6 by Terry Jan Reedy in branch 'master': bpo-27115: Move IDLE Query error blanking (GH-18868) https://github.com/python/cpython/commit/e53a3932cb01683b0fa8a7448ca25a2e658c39e6 --

[issue27115] IDLE goto should use query.Query subclass

2020-03-08 Thread miss-islington
Change by miss-islington : -- pull_requests: +18228 pull_request: https://github.com/python/cpython/pull/18870 ___ Python tracker ___

[issue27115] IDLE goto should use query.Query subclass

2020-03-08 Thread Terry J. Reedy
Change by Terry J. Reedy : -- keywords: +patch pull_requests: +18226 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/18868 ___ Python tracker

[issue39852] IDLE: Goto should remove selection and update the status bar

2020-03-08 Thread Guido van Rossum
Guido van Rossum added the comment: I have a nit on the commit message used here (and also in issue 39885). *Please* don't use this style of commit message "IDLE context menu clears selection". That phrasing sounds like it is the description of a bug. Please always use a phrasing that makes

[issue27115] IDLE goto should use query.Query subclass

2020-03-08 Thread Terry J. Reedy
Terry J. Reedy added the comment: The related issue is #39852. Since its PR-18801 fixed the status issue, I am returning this to the box replacement issue. -- ___ Python tracker

[issue27115] IDLE goto should use query.Query subclass

2020-03-08 Thread Terry J. Reedy
Terry J. Reedy added the comment: Since PR-18801 fixed the status issue, I am returning this to the box replacement issue. -- title: IDLE goto should always update status bar line & column -> IDLE goto should use query.Query subclass ___

[issue39852] IDLE: Goto should remove selection and update the status bar

2020-03-08 Thread miss-islington
miss-islington added the comment: New changeset ec61f53243a4455f41e37a5c645e668661952c28 by Miss Islington (bot) in branch '3.7': bpo-39852: IDLE 'Go to line' deletes selection, updates status (GH-18801) https://github.com/python/cpython/commit/ec61f53243a4455f41e37a5c645e668661952c28

[issue39852] IDLE: Goto should remove selection and update the status bar

2020-03-08 Thread Terry J. Reedy
Change by Terry J. Reedy : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue39852] IDLE: Goto should remove selection and update the status bar

2020-03-08 Thread miss-islington
miss-islington added the comment: New changeset a5e821c7269ebed6e8b4b4eee3f2247ec41a9788 by Miss Islington (bot) in branch '3.8': bpo-39852: IDLE 'Go to line' deletes selection, updates status (GH-18801) https://github.com/python/cpython/commit/a5e821c7269ebed6e8b4b4eee3f2247ec41a9788

[issue39852] IDLE: Goto should remove selection and update the status bar

2020-03-08 Thread miss-islington
Change by miss-islington : -- pull_requests: +18215 pull_request: https://github.com/python/cpython/pull/18858 ___ Python tracker ___

[issue39852] IDLE: Goto should remove selection and update the status bar

2020-03-08 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +18214 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/18857 ___ Python tracker

[issue39852] IDLE: Goto should remove selection and update the status bar

2020-03-08 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset 2522db11df102be3baf25ce9e816ebe8ffdb7fcc by Terry Jan Reedy in branch 'master': bpo-39852: IDLE 'Go to line' deletes selection, updates status (GH-18801) https://github.com/python/cpython/commit/2522db11df102be3baf25ce9e816ebe8ffdb7fcc

[issue39852] IDLE: Goto should remove selection and update the status bar

2020-03-06 Thread Terry J. Reedy
Terry J. Reedy added the comment: Agreed about right clicks. See new issue #39885. -- ___ Python tracker ___ ___ Python-bugs-list

[issue39852] IDLE: Goto should remove selection and update the status bar

2020-03-06 Thread Dave Liptack
Dave Liptack added the comment: Like goto, right-click also exhibits this behavior. Should selection_clear also be added to right-click code? -- ___ Python tracker <https://bugs.python.org/issue39

[issue39852] IDLE: Goto should remove selection and update the status bar

2020-03-05 Thread Terry J. Reedy
Terry J. Reedy added the comment: I am expanding this issue to include the part of #27115 that the PR will fix. (I will also change the scope of the latter). -- stage: patch review -> needs patch title: IDLE: Goto should remove any selection -> IDLE: Goto should remove sel

[issue39852] IDLE: Goto should remove any selection

2020-03-05 Thread Terry J. Reedy
Change by Terry J. Reedy : -- keywords: +patch pull_requests: +18157 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/18801 ___ Python tracker

[issue39852] IDLE: Goto should remove any selection

2020-03-05 Thread Terry J. Reedy
Terry J. Reedy added the comment: selection_clear only partially clears a selection. That it does something is proven by selection_clear.py. It disables selection_get. But run the file in IDLE and when it finishes, click the tk window, select a line, click Shell, and manually repeat the

[issue27115] IDLE goto should always update status bar line & column

2020-03-05 Thread Terry J. Reedy
. The line number query box should just return a positive int or None, without side-effect. So we should make sure that Query boxes do not leak key events and create a subclass to get a positive int. But such a replacement is somewhat independent of triggering <>. A related issue is tha

[issue39852] IDLE: Goto should remove any selection

2020-03-05 Thread Terry J. Reedy
in. So either of your steps 6 or 7 delete the still selected line, after the goto. (And so a click is needed before 6 to stop the deletion.) I see the continued selection as the problem. Both Notepad and Notepad++ unselect any selection upon goto, the same as if one moved the cursor by clicking

Re: Goto

2018-01-02 Thread John Wong
I think the point is there is not much to discuss. Goto is not going to be added. Furthermore, for every program language you want to translate from source, you have to find a workaround. Otherwise, your translation will only work for languages that have goto. Even so the implementation may

Re: Python goto

2018-01-02 Thread Chris Angelico
On Wed, Jan 3, 2018 at 5:16 AM, Rob Gaddi <rgaddi@highlandtechnology.invalid> wrote: > On 12/28/2017 04:35 AM, Skip Montanaro wrote: >> >> Jorge> I would like to know if there is a goto command or something >> similar that >> Jorge> I can use in Python.

Re: Python goto

2018-01-02 Thread Rob Gaddi
On 12/28/2017 04:35 AM, Skip Montanaro wrote: Jorge> I would like to know if there is a goto command or something similar that Jorge> I can use in Python. Ned> Python does not have a goto statement. You have to use structured Ned> statements: for, while, try/except, yield, return,

Re: Goto

2018-01-02 Thread bartc
d need to use it on my own terms, regardless of whether the result is 'pythonic'. If the language had 'goto', then I would use it if I found it apt. However, the discussion here is academic, so it doesn't matter who uses what. Apart from anything else, Python is never going to officially

Re: Goto

2018-01-02 Thread Chris Angelico
On Wed, Jan 3, 2018 at 1:51 AM, bartc wrote: > On 29/12/2017 18:11, Chris Angelico wrote: >> >> On Sat, Dec 30, 2017 at 4:13 AM, bartc wrote: >>> >>> If you want to translate code from one language to another, and the >>> source >>> language uses gotos, or uses

Re: Goto

2018-01-02 Thread bartc
On 29/12/2017 18:11, Chris Angelico wrote: On Sat, Dec 30, 2017 at 4:13 AM, bartc wrote: If you want to translate code from one language to another, and the source language uses gotos, or uses control structures not available in the target language, then gotos would be very

Re: Goto (Posting On Python-List Prohibited)

2018-01-01 Thread Chris Angelico
On Tue, Jan 2, 2018 at 9:11 AM, wrote: > On Monday, January 1, 2018 at 9:35:06 PM UTC, Chris Angelico wrote: >> On Tue, Jan 2, 2018 at 7:16 AM, Chris Green wrote: >> > Dennis Lee Bieber wrote: >> >> >> >> Well... "break" does bypass the rest of the block, but it

Re: Goto (Posting On Python-List Prohibited)

2018-01-01 Thread breamoreboy
On Monday, January 1, 2018 at 9:35:06 PM UTC, Chris Angelico wrote: > On Tue, Jan 2, 2018 at 7:16 AM, Chris Green wrote: > > Dennis Lee Bieber wrote: > >> > >> Well... "break" does bypass the rest of the block, but it still > >> exits > >> via the end of the block. I have a tendency to

Re: Goto (Posting On Python-List Prohibited)

2018-01-01 Thread Chris Angelico
On Tue, Jan 2, 2018 at 7:16 AM, Chris Green wrote: > Dennis Lee Bieber wrote: >> >> Well... "break" does bypass the rest of the block, but it still exits >> via the end of the block. I have a tendency to try for one "return" per >> procedure (so I'm

Re: Goto (Posting On Python-List Prohibited)

2018-01-01 Thread Chris Green
Dennis Lee Bieber wrote: > > Well... "break" does bypass the rest of the block, but it still exits > via the end of the block. I have a tendency to try for one "return" per > procedure (so I'm more likely to have an "if ...: break" then "if ...: > return"). I

Re: Goto (Posting On Python-List Prohibited)

2018-01-01 Thread John Q Hacker
>> >> Good for you. >> >> Looking at 14 million lines of Linux kernel sources, which are in C, >> over 100,000 of them use 'goto'. About one every 120 lines. > > Most use of goto's implies a lack of understanding of the unseen > architecture of the prob

Re: Goto (Posting On Python-List Prohibited)

2018-01-01 Thread John Q Hacker
>> I don’t use gotos in C code. Why should it be “harder” in a higher-level >> language? > > Good for you. > > Looking at 14 million lines of Linux kernel sources, which are in C, > over 100,000 of them use 'goto'. About one every 120 lines. Most use of goto's impl

Re: Goto (Posting On Python-List Prohibited)

2018-01-01 Thread From
(Posting On Python-List Prohibited) why ? -- https://mail.python.org/mailman/listinfo/python-list

Re: Goto (Posting On Python-List Prohibited)

2018-01-01 Thread bartc
On 01/01/2018 15:06, From wrote: (Posting On Python-List Prohibited) why ? Huh? I'm posting to the usenet group comp.lang.python (an off-topic reply to an off-topic remark, but it happens). I've no idea what the prohibited part is about, if that's what you're

Re: Goto (Posting On Python-List Prohibited)

2018-01-01 Thread bartc
On 01/01/2018 14:54, Peter J. Holzer wrote: On 2017-12-30 11:07:56 -0500, Dennis Lee Bieber wrote: Yes. I don't know any language which enforces "pure" structured programming. They all have some constructs (goto, break, return, exceptions, ...) to leave a block early. I d

Re: Goto (Posting On Python-List Prohibited)

2018-01-01 Thread Peter J. Holzer
lock structured language and Dijkstra wrote > >"goto considered harmful" in the late 1960s. Pascal appeared in 1970, C > >in 1974. To me (who learned to program in BASIC on a CP/M machine), C > >is very much a structured programming language. If structured > >p

Re: Goto (Posting On Python-List Prohibited)

2018-01-01 Thread breamoreboy
On Sunday, December 31, 2017 at 6:56:16 PM UTC, bartc wrote: > On 31/12/2017 17:01, breamoreboy wrote: > > >Further I've never once in 17 years of using Python been tearing my hair out > >over the lack of goto > > Neither have I over all the advanced featur

Re: Goto (Posting On Python-List Prohibited)

2018-01-01 Thread bartc
On 01/01/2018 00:40, MRAB wrote: On 2017-12-31 23:21, bartc wrote: [Block delimiting] proc fn2(int a)= ... end (or possibly "inline f123="). [snip] OT: if "case ... esac" and "if ... fi", why not "proc ... corp"? :-) (I don't think Algol-68 used corp otherwise it might have been

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread bartc
On 31/12/2017 17:01, breamore...@gmail.com wrote: Further I've never once in 17 years of using Python been tearing my hair out over the lack of goto Neither have I over all the advanced features of Python I never use, and for double that number of years. Yet for some

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread mm0fmf
On 31/12/2017 17:01, breamore...@gmail.com wrote: I would use functions every time as a modern compiler can inline them This Further I've never once in 17 years of using Python been tearing my hair out over the lack of goto And this. (In my case only 6 years.) -- https://mail.python.org

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread Ben Bacarisse
bartc <b...@freeuk.com> writes: > On 31/12/2017 22:09, Ben Bacarisse wrote: > >> No, you missed the point and did not address the question. You said (now >> cut) >> >> | If I thought introducing functions, whether local or not, as a way of >> | av

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread MRAB
On 2017-12-31 23:21, bartc wrote: On 31/12/2017 22:09, Ben Bacarisse wrote: No, you missed the point and did not address the question. You said (now cut) | If I thought introducing functions, whether local or not, as a way of | avoiding goto was worth doing, I would do so. but I'm not sure

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread bartc
On 31/12/2017 22:09, Ben Bacarisse wrote: No, you missed the point and did not address the question. You said (now cut) | If I thought introducing functions, whether local or not, as a way of | avoiding goto was worth doing, I would do so. but I'm not sure you know if it's worth

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread Ben Bacarisse
fficient either. No, you missed the point and did not address the question. You said (now cut) | If I thought introducing functions, whether local or not, as a way of | avoiding goto was worth doing, I would do so. but I'm not sure you know if it's worth it or not. So here's my question again: wha

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread Chris Angelico
> print ("Four") > else: > print ("Other") > F123() > > However, if I call this with fn2(3), it says that variable F123 has not been > assigned. Right, so you'd move it one line up (or move the 'if' down to below the funct

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread bartc
On 31/12/2017 19:29, bartc wrote: [Ignore the original, incomplete version of my post, which appears after the sig. I decided to actually try it out for real instead of just guessing! Good thing too.] -- https://mail.python.org/mailman/listinfo/python-list

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread bartc
123() is not called? A brief test [not using print()] showed it was a little slower having F123 inside fn2() - and outside the if-statement to make it work - than having F123 outside. And having to call F123() anyway instead of just having the inline code makes it a little slower too. Altho

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread breamoreboy
Chris Angelico wrote: > > > >>>> I've written code that uses dirty tricks like that to avoid > >>>> duplication. It's at least as much of a problem as actual duplication > >>>> is. Generally, the 'goto' solution results in subsequent programmers > &

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread Chris Angelico
On Mon, Jan 1, 2018 at 3:55 AM, bartc wrote: >> The suggestion was to use them to avoid gotos. If duplicating is a good >> idea (and it's a hard line to draw) then we are not talking about the >> same cases. Given the choice of "dragging in named functions" and >> dragging in

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread bartc
On 31/12/2017 15:02, Ben Bacarisse wrote: bartc writes: I think there's a problem with that. Standard C does not have them, you said your language does not implement them properly (The real problem is I don't remember local functions being used anywhere else. It's an

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread Ben Bacarisse
that to avoid >>>> duplication. It's at least as much of a problem as actual duplication >>>> is. Generally, the 'goto' solution results in subsequent programmers >>>> (such as my future selves) staring at the code for 30-60 seconds to >>>> figure out w

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread bartc
cation is. Generally, the 'goto' solution results in subsequent programmers (such as my future selves) staring at the code for 30-60 seconds to figure out what it's doing. I don't like to do that to myself, much less to people I actually admire and respect. The problem is having to stare at the code fo

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread Chris Angelico
;>>> >>>> bartc wrote: >>>>> >>>>> >>>>> B and C occur twice, so a goto is a quick way to reuse B and C without >>>>> needing to duplicate code, >>>> >>>> >>>> >>>> This on

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread bartc
On 30/12/2017 23:54, Chris Angelico wrote: On Sun, Dec 31, 2017 at 10:45 AM, bartc <b...@freeuk.com> wrote: On 30/12/2017 23:26, Gregory Ewing wrote: bartc wrote: B and C occur twice, so a goto is a quick way to reuse B and C without needing to duplicate code, This only

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread Ben Bacarisse
tion almost certainly scales better and >> will allow for better structuring (such as when one block needs to use >> another one). > > Using a local (or even non-local) function is what I'm trying to > avoid, as I prefer to keep the code inline, and not disrupt it too > mu

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread MRAB
On 2017-12-30 23:22, Gregory Ewing wrote: Stefan Ram wrote: BASIC has DEF FN... which /can/ define actual subroutines, limited to expressions. Now, what does this limitation remind me of? The equivalent limitation in Python is nowhere near as bad, since if you outgrow what lambda can

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread Chris Angelico
On Sun, Dec 31, 2017 at 10:45 AM, bartc <b...@freeuk.com> wrote: > On 30/12/2017 23:26, Gregory Ewing wrote: >> >> bartc wrote: >>> >>> B and C occur twice, so a goto is a quick way to reuse B and C without >>> needing to duplicate code, >&

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread bartc
On 30/12/2017 23:26, Gregory Ewing wrote: bartc wrote: B and C occur twice, so a goto is a quick way to reuse B and C without needing to duplicate code, This only works if the repeated part happens to be at the tail of each case. IME that seems to be the most common situation. Any other

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread Gregory Ewing
bartc wrote: B and C occur twice, so a goto is a quick way to reuse B and C without needing to duplicate code, This only works if the repeated part happens to be at the tail of each case. Any other situation and you're back to local functions. -- Greg -- https://mail.python.org/mailman

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread Gregory Ewing
bartc wrote: C doesn't in general have local functions. My own languages don't implement them properly. So I tend not to use them. Looks like there's something circular going on here. You don't have much experience of using local functions, so you don't see a lot of value in them, so you

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread Gregory Ewing
Stefan Ram wrote: BASIC has DEF FN... which /can/ define actual subroutines, limited to expressions. Now, what does this limitation remind me of? The equivalent limitation in Python is nowhere near as bad, since if you outgrow what lambda can do you can always use a def instead. BASIC

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread Chris Angelico
est. So you don't want to go to the trouble of hoisting a block of code > into a local function. > > (And in C, which has local block scopes, there would be trouble with > visibility of all the variables the block uses, unless the local function is > untidily placed right where the original block was.) > Okay, so a low level language lacks certain facilities. Great. What has this to do with Python and goto? You *can* use nested functions. And they can do everything you need of these sub-blocks (albeit with some overhead). ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread bartc
On 30/12/2017 20:36, Ben Bacarisse wrote: bartc writes: On 30/12/2017 16:53, mm0fmf wrote: On 30/12/2017 14:41, bartc wrote: it looks a bit naff Understatement of 2017. I'm honest about my own ideas, but my remarks were about the use of special symbols such as "::" and

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread William Ray Wing
es of Linux kernel sources, which are in C, >>> over 100,000 of them use 'goto'. About one every 120 lines. >>> >> >> C is a language that predates the "structured programming" concepts of >> the late 70/early 80. > > I don't think th

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread Chris Angelico
On Sun, Dec 31, 2017 at 7:36 AM, Ben Bacarisse wrote: > bartc writes: > >> On 30/12/2017 16:53, mm0fmf wrote: >>> On 30/12/2017 14:41, bartc wrote: it looks a bit naff >>> >>> Understatement of 2017. >> >> I'm honest about my own ideas, but my remarks

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread Ben Bacarisse
bartc writes: > On 30/12/2017 16:53, mm0fmf wrote: >> On 30/12/2017 14:41, bartc wrote: >>> it looks a bit naff >> >> Understatement of 2017. > > I'm honest about my own ideas, but my remarks were about the use of > special symbols such as "::" and "@". > > Before completely

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread Ian Kelly
On Sat, Dec 30, 2017 at 8:41 AM, bartc <b...@freeuk.com> wrote: > (I had introduced a special language feature just for this kind of thing, > but it was unsatisfactory. Goto was simpler and understood by everyone. And > portable to any other language - that hasn't done

  1   2   3   4   5   6   >