[issue44875] Update dis.findlinestarts documentaiton to reflect new usage of `co_lines` (PEP 626)

2022-01-03 Thread laike9m


laike9m  added the comment:

Agreed. The current doc for `findlinestarts` is outdated.

--
nosy: +laike9m

___
Python tracker 
<https://bugs.python.org/issue44875>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40790] Python should enable computed gotos on Mac by default

2020-06-01 Thread laike9m


laike9m  added the comment:

You're right. The part I don't understand is how `--without-computed-gotos`
disabled the feature. Also I guess since this feature is meant to be
transparent to users, it's ok to not have a way to inspect it.

On Mon, Jun 1, 2020 at 12:51 AM Ronald Oussoren 
wrote:

>
> Ronald Oussoren  added the comment:
>
> Looking at the source code at <
> https://github.com/python/cpython/blob/a871f692b4a2e6c7d45579693e787edc0af1a02c/Python/ceval.c#L1024>:
> computed gotos are enabled automatically when they are available.
>
> --
>
> ___
> Python tracker 
> <https://bugs.python.org/issue40790>
> ___
>

--

___
Python tracker 
<https://bugs.python.org/issue40790>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40790] Python should enable computed gotos on Mac by default

2020-05-31 Thread laike9m


laike9m  added the comment:

Thanks Ronald. I wrote an answer to summarize what I got so far:

https://stackoverflow.com/a/62037189/2142577

There's nothing wrong with the current behavior, so nothing really needs to be 
changed. But we still lack a way for users to check whether computed gotos is 
enabled out of the box, and `HAVE_COMPUTED_GOTOS` can't do the job either since 
it only detects the compiler's capability.

--

___
Python tracker 
<https://bugs.python.org/issue40790>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40790] Python should enable computed gotos on Mac by default

2020-05-27 Thread laike9m


laike9m  added the comment:

Hi Benjamin, do you mean that disabling computed gotos on Mac is the expected 
behavior?

--

___
Python tracker 
<https://bugs.python.org/issue40790>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40790] Python should enable computed gotos on Mac by default

2020-05-27 Thread laike9m


New submission from laike9m :

Issue is described here with more details:
https://stackoverflow.com/q/61860463/2142577

Basically, when building on Mac, Python should enable computed gotos by 
default, because it is supported (https://stackoverflow.com/a/62037189/2142577).

The 
documentation(https://docs.python.org/3/whatsnew/3.2.html#build-and-c-api-changes)
 says
> Computed gotos are now enabled by default on supported compilers (which are 
> detected by the configure script). They can still be disabled selectively by 
> specifying --without-computed-gotos.

This seems to imply that the capability detection is wrong.

--
components: macOS
messages: 370051
nosy: laike9m, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: Python should enable computed gotos on Mac by default
type: behavior
versions: Python 3.10

___
Python tracker 
<https://bugs.python.org/issue40790>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40169] `dis.findlabels()` should accept a code object

2020-04-04 Thread laike9m


Change by laike9m :


--
type: enhancement -> behavior

___
Python tracker 
<https://bugs.python.org/issue40169>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40169] `dis.findlabels()` should accept a code object

2020-04-04 Thread laike9m


Change by laike9m :


--
keywords: +patch
pull_requests: +18717
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19356

___
Python tracker 
<https://bugs.python.org/issue40169>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40169] `dis.findlabels()` should accept a code object

2020-04-03 Thread laike9m


New submission from laike9m :

Continuing our discussion in https://bugs.python.org/issue40122.

I would like to make `dis.findlabels()` accept a code object just like other 
APIs in the dis module. Also this can be a good chance to add tests for it.

--
components: Library (Lib)
messages: 365684
nosy: laike9m, serhiy.storchaka
priority: normal
severity: normal
status: open
title: `dis.findlabels()` should accept a code object
type: enhancement
versions: Python 3.9

___
Python tracker 
<https://bugs.python.org/issue40169>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40122] The implementation and documentation of "dis.findlables" don't match

2020-03-31 Thread laike9m


laike9m  added the comment:

I've created a PR to fix documentation.
https://github.com/python/cpython/pull/19274

I'll create a new issue for making the function accept a code object.

--

___
Python tracker 
<https://bugs.python.org/issue40122>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40122] The implementation and documentation of "dis.findlables" don't match

2020-03-31 Thread laike9m


Change by laike9m :


--
keywords: +patch
pull_requests: +18629
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/19274

___
Python tracker 
<https://bugs.python.org/issue40122>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40122] The implementation and documentation of "dis.findlables" don't match

2020-03-31 Thread laike9m


New submission from laike9m :

The documentation of dis.findlabels says:

> dis.findlabels(code)
> Detect all offsets in the code object code which are jump targets, and return 
> a list of these offsets.

But the implementation actually expects a raw compiled bytecode.

>>> def f():pass

>>> dis.findlabels(f.__code__)
Traceback (most recent call last):
  File "", line 1, in 
  File "/Users/laike9m/.pyenv/versions/3.7.4/lib/python3.7/dis.py", line 424, 
in findlabels
for offset, op, arg in _unpack_opargs(code):
  File "/Users/laike9m/.pyenv/versions/3.7.4/lib/python3.7/dis.py", line 408, 
in _unpack_opargs
for i in range(0, len(code), 2):
TypeError: object of type 'code' has no len()

>>> dis.findlabels(f.__code__.co_code)
[]

Since the other functions in the dis module all accept a code object rather 
than compiled code, I would suggest change the code instead of documentation.

Plus, this function does not seem to be tested anywhere. I can make a PR if 
this issue is confirmed.

--
components: Library (Lib)
messages: 365367
nosy: laike9m, serhiy.storchaka
priority: normal
severity: normal
status: open
title: The implementation and documentation of "dis.findlables" don't match
versions: Python 3.9

___
Python tracker 
<https://bugs.python.org/issue40122>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30951] Documentation error in inspect module

2020-03-22 Thread laike9m


Change by laike9m :


--
nosy: +laike9m

___
Python tracker 
<https://bugs.python.org/issue30951>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32625] Update the dis module documentation to reflect switch to wordcode

2019-06-11 Thread laike9m


Change by laike9m :


--
keywords: +patch
pull_requests: +13865
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/13985

___
Python tracker 
<https://bugs.python.org/issue32625>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com