Skip to content

Conversation

@gaogaotiantian
Copy link
Member

This is a minor change on pdb docs. The doc use to give an alias example below:

# Print instance variables (usage "pi classInst")
alias pi for k in %1.__dict__.keys(): print("%1.",k,"=",%1.__dict__[k])

However, using this alias, there will be a space between the object name and the attribute like self. attr = 1, which is not how we are used to. By using f-strings(which is supported on all live python versions), we can make the alias do self.attr = 1

@bedevere-bot bedevere-bot added docs Documentation in the Doc dir skip news awaiting review labels Mar 21, 2023
@erlend-aasland erlend-aasland changed the title [doc] pdb alias example improvement Docs: improve accuracy of pdb alias example Mar 22, 2023
@erlend-aasland
Copy link
Contributor

Related (and out of scope for this PR): IMO, the pdb docs should be updated to use doctests, so we'll catch non-working examples in the docs.

@erlend-aasland erlend-aasland added needs backport to 3.10 only security fixes needs backport to 3.11 only security fixes and removed awaiting merge labels Mar 22, 2023
@erlend-aasland erlend-aasland merged commit e0c63b7 into python:main Mar 22, 2023
@miss-islington
Copy link
Contributor

Thanks @gaogaotiantian for the PR, and @erlend-aasland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-102906 is a backport of this pull request to the 3.11 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Mar 22, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 22, 2023
(cherry picked from commit e0c63b7)

Co-authored-by: gaogaotiantian <gaogaotiantian@hotmail.com>
@bedevere-bot
Copy link

GH-102907 is a backport of this pull request to the 3.10 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Mar 22, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 22, 2023
(cherry picked from commit e0c63b7)

Co-authored-by: gaogaotiantian <gaogaotiantian@hotmail.com>
miss-islington added a commit that referenced this pull request Mar 22, 2023
(cherry picked from commit e0c63b7)

Co-authored-by: gaogaotiantian <gaogaotiantian@hotmail.com>
miss-islington added a commit that referenced this pull request Mar 22, 2023
(cherry picked from commit e0c63b7)

Co-authored-by: gaogaotiantian <gaogaotiantian@hotmail.com>
@gaogaotiantian gaogaotiantian deleted the pdb-alias-doc-improve branch March 23, 2023 23:29
Fidget-Spinner pushed a commit to Fidget-Spinner/cpython that referenced this pull request Mar 27, 2023
warsaw pushed a commit to warsaw/cpython that referenced this pull request Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip issue skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants