Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
Accelerator
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Type
/
to search
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
Uh oh!
There was an error while loading.
Please reload this page
.
python
/
cpython
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
35.2k
Star
74.2k
Code
Issues
5k+
Pull requests
2.5k
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
bpo-33234 Improve list() pre-sizing for inputs with known lengths (no __length_hint__)
- #9846
#9846
Merged
pablogsal
merged 10 commits into
python:master
python/cpython:master
from
pablogsal:bpo33234-2
pablogsal/cpython:bpo33234-2
Copy head branch name to clipboard
Oct 28, 2018
Conversation
Commits
10
(10)
Checks
Files changed
Merged
bpo-33234 Improve list() pre-sizing for inputs with known lengths (no __length_hint__)
#9846
pablogsal
merged 10 commits into
python:master
python/cpython:master
from
pablogsal:bpo33234-2
pablogsal/cpython:bpo33234-2
Copy head branch name to clipboard
Commits
Commits on Apr 17, 2018
Improve list() pre-sizing for inputs with known lengths
Show description for 7602879
pablogsal
committed
7602879
View commit details
Copy full SHA for 7602879
Browse repository at this point
Commits on Oct 13, 2018
Preallocate only when __len__ is available to avoid loss of performance for small iterables
pablogsal
committed
39a8757
View commit details
Copy full SHA for 39a8757
Browse repository at this point
Commits on Oct 15, 2018
Fix NEWS entry and correct style
pablogsal
committed
ab450b3
View commit details
Copy full SHA for ab450b3
Browse repository at this point
Commits on Oct 23, 2018
Use _PyObject_HasLen to check if the object has lenght to avoid overhead
pablogsal
committed
717ca67
View commit details
Copy full SHA for 717ca67
Browse repository at this point
Simplify implementation and don't capture all expections on error
pablogsal
committed
b678442
View commit details
Copy full SHA for b678442
Browse repository at this point
Commits on Oct 25, 2018
Add assert and fix formatting
pablogsal
committed
b40bd62
View commit details
Copy full SHA for b40bd62
Browse repository at this point
Remove uneeded test modification
pablogsal
committed
3837486
View commit details
Copy full SHA for 3837486
Browse repository at this point
Commits on Oct 26, 2018
Don't preallocate if list is modified when calling PyObject_Size
pablogsal
committed
b6ff7ce
View commit details
Copy full SHA for b6ff7ce
Browse repository at this point
Improve readability in the error handling branch
pablogsal
committed
e7f8c46
View commit details
Copy full SHA for e7f8c46
Browse repository at this point
Commits on Oct 28, 2018
Capture only TypeError as suggested by Serhiy
pablogsal
committed
0a6c8ba
View commit details
Copy full SHA for 0a6c8ba
Browse repository at this point
You can’t perform that action at this time.