Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

fannkuch benchmark & implicit returns

Open
#115 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
compilers

Research direction

Start with fannkuch_static_basic_lib.py and reproduce the Cinder 3.10 error using the minimal main() example in the issue. Trace the implicit-return analysis for annotated functions with a while loop and conditional return, then verify that fannkuch and the small example compile without the erroneous TypedSyntaxError.

Written by the indexing model from the issue text.

Description

On Cinder 3.10, fannkuch_static_basic_lib.py gives a type error about implicitly returning None:

 File "fannkuch_static_basic_lib.py", line 15
    def fannkuch(n: int) -> int:
compiler.errors.TypedSyntaxError: Function has declared return type 'int' but can implicitly return None.

Here's a small program with the same error:

def main()->int:
  while 1:
    if 0:
      pass
    else:
      return 4

main()

A quick fix is to add return 0 or something to the bottom of fannkuch. But maybe the implicit return analysis needs an upgrade.

cc @vivaan2006 who helped discover this

Dominant language
Python
Stars
3.8k
Forks
139
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from facebookincubator/MetaPython

All issues in facebookincubator/MetaPython

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.