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
generate_password function to allow users to specify the desired complexity, with flags for including/excluding digits and punctuation. This would provide more flexibility for users who may have varying security requirements or restrictions
To support the include_digits and include_punctuation flags effectively, the generate_password function should also expose a length parameter to ensure these constraints don't cause conflicts when the requested set of characters is too small. Should the function prioritize meeting the minimum length or strictly adhere to the exclusion flags if the character pool becomes exhausted?
If we implement these flags, how should the function handle the case where length is smaller than the sum of required character types to avoid ValueError or an infinite loop?
Activity
damianoecker26 commentedon Sep 18, 2026
=True
,include_punctuation=True`.Fi6uDvGWucFv commentedon Sep 19, 2026
To support the
include_digitsandinclude_punctuationflags effectively, thegenerate_passwordfunction should also expose a length parameter to ensure these constraints don't cause conflicts when the requested set of characters is too small. Should the function prioritize meeting the minimum length or strictly adhere to the exclusion flags if the character pool becomes exhausted?jadayaanaliah26 commentedon Oct 21, 2026
If we implement these flags, how should the function handle the case where
lengthis smaller than the sum of required character types to avoidValueErroror an infinite loop?