Skip to content

Conversation

@moneebullah25
Copy link
Contributor

@moneebullah25 moneebullah25 commented Jan 11, 2026

Fixes #143674

Changes

  • Added documentation for F (complex from two floats) and D (complex from two doubles) format characters to the struct module docstring

Rationale

These format characters are implemented in the struct module (lines 858-859, 1189-1190, 1504-1505 in Modules/_struct.c) but were missing from the module's docstring documentation. Users consulting the docstring with help(struct) would not know these options exist.

Testing

  • Verified that F and D format characters are implemented in the code
  • Confirmed the docstring change follows the existing format and style
  • The change is minimal and only adds missing documentation

Checklist

  • Minimal change - only added missing documentation
  • Followed existing docstring format and style
  • Commit message follows CPython guidelines

Add documentation for the F (complex from two floats) and D (complex
from two doubles) format characters in the struct module docstring.
These format characters were implemented but not documented.
@bedevere-app

This comment was marked as resolved.

@python-cla-bot

This comment was marked as resolved.

@moneebullah25

This comment was marked as resolved.

@skirpichev
Copy link
Member

Are you using generative AI for this pr?

@moneebullah25
Copy link
Contributor Author

Are you using generative AI for this pr?

Yep I use it for commit message and comment

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
@bedevere-app

This comment was marked as resolved.

@skirpichev skirpichev added the needs backport to 3.14 bugs and security fixes label Jan 11, 2026
@python python locked as spam and limited conversation to collaborators Jan 11, 2026
@hugovk
Copy link
Member

hugovk commented Jan 11, 2026

Reported @quanghuynh10111-lab to GitHub.

@python python unlocked this conversation Jan 12, 2026
@vstinner vstinner merged commit 3e93225 into python:main Jan 16, 2026
52 checks passed
@miss-islington-app
Copy link

Thanks @moneebullah25 for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 16, 2026
…ule (pythonGH-143675)

Add documentation for the F (complex from two floats) and D (complex
from two doubles) format characters in the struct module docstring.
These format characters were implemented but not documented.
(cherry picked from commit 3e93225)

Co-authored-by: Muneeb Ullah <moneebullah25@gmail.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Jan 16, 2026

GH-143918 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Jan 16, 2026
@vstinner
Copy link
Member

Merged, thank you.

vstinner pushed a commit that referenced this pull request Jan 16, 2026
…dule (GH-143675) (#143918)

gh-143674: Document F/D complex format characters in struct module (GH-143675)

Add documentation for the F (complex from two floats) and D (complex
from two doubles) format characters in the struct module docstring.
These format characters were implemented but not documented.
(cherry picked from commit 3e93225)

Co-authored-by: Muneeb Ullah <moneebullah25@gmail.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot ARM64 macOS 3.x (tier-2) has failed when building commit 3e93225.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/725/builds/12571) and take a look at the build logs.
  4. Check if the failure is related to this commit (3e93225) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/725/builds/12571

Failed tests:

  • test_urllib2net

Summary of the results of the build (if available):

==

Click to see traceback logs
remote: Enumerating objects: 4, done.        
remote: Counting objects:  25% (1/4)        
remote: Counting objects:  50% (2/4)        
remote: Counting objects:  75% (3/4)        
remote: Counting objects: 100% (4/4)        
remote: Counting objects: 100% (4/4), done.        
remote: Compressing objects:  25% (1/4)        
remote: Compressing objects:  50% (2/4)        
remote: Compressing objects:  75% (3/4)        
remote: Compressing objects: 100% (4/4)        
remote: Compressing objects: 100% (4/4), done.        
remote: Total 4 (delta 0), reused 3 (delta 0), pack-reused 0 (from 0)        
From https://github.com/python/cpython
 * branch                    main       -> FETCH_HEAD
Note: switching to '3e932257980be8907698c378c23026e262ba066c'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 3e932257980 gh-143674: Document F/D complex format characters in struct module (#143675)
Switched to and reset branch 'main'

make: *** [buildbottest] Error 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Struct module docstring lacks format characters for complex types (F/D)

5 participants