Make futures demo compatible with Python 3 - #119
Open
ai-yang wants to merge 1 commit into
Open
Conversation
|
ai-yang
marked this pull request as ready for review
July 31, 2026 15:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
pyfutures/futuresDemo.py中 9 处可执行的 Python 2print语句转换为 Python 3 调用。Motivation and Context
仓库工作流声明使用 Python 3.8/3.9,但该示例在解析阶段即因 Python 2
print语法失败,无法导入或运行。Related issue: none. 上游当前限制此账号创建 Issue(GitHub API 返回 403),因此复现、根因和测试信息完整记录在本 PR 中。
How Has This Been Tested?
python -m py_compile pyfutures/futuresDemo.py:连续 3 次通过flake8 --select=E9,F63,F7,F82 pyfutures/futuresDemo.pygit diff --check origin/main...HEAD全仓
compileall当前还会被独立的pytrader/data/data_utils.py方法签名语法错误阻塞;该错误不由本 PR 引入,并已拆分为另一独立修复。未运行真实 CTP 集成测试,以避免连接交易前置机。
Types of changes