-
-
Notifications
You must be signed in to change notification settings - Fork 747
Add !exec alias to clarify command behavior #3390
Copy link
Copy link
Closed
Labels
a: frontendRelated to output and formattingRelated to output and formattinga: utilityRelated to utility commands: (bot, eval, extensions, jams, reminders, snekbox, utils)Related to utility commands: (bot, eval, extensions, jams, reminders, snekbox, utils)good first issueGood for newcomersGood for newcomersl: 0 - beginnerp: -1 - super criticalSubstance at a temperature and pressure above its critical pointSubstance at a temperature and pressure above its critical pointstatus: approvedThe issue has received a core developer's approvalThe issue has received a core developer's approvalt: enhancementChanges or improvements to existing featuresChanges or improvements to existing features
Metadata
Metadata
Assignees
Labels
a: frontendRelated to output and formattingRelated to output and formattinga: utilityRelated to utility commands: (bot, eval, extensions, jams, reminders, snekbox, utils)Related to utility commands: (bot, eval, extensions, jams, reminders, snekbox, utils)good first issueGood for newcomersGood for newcomersl: 0 - beginnerp: -1 - super criticalSubstance at a temperature and pressure above its critical pointSubstance at a temperature and pressure above its critical pointstatus: approvedThe issue has received a core developer's approvalThe issue has received a core developer's approvalt: enhancementChanges or improvements to existing featuresChanges or improvements to existing features
Type
Fields
Give feedbackNo fields configured for issues without a type.
Opened on behalf of @python-discord/devops
Problem
Earlier today I received notice from my Vice-Best Man @ChrisLovering that we were misinforming users who were using the
!evalcommand functionality of this project.Chris rightly pointed out that the
!evalcommand behavior is actually really!exec- we spawn a new Python process to execute the user's code, going far beyond the capabilities of the plain oldeval()built-in.Current Behavior
The
!evalcommand currently:This is fundamentally different from Python's
eval()function, which:Proposed Solution
Add an
!execalias that provides the same functionality as!eval.Benefits
eval()andexec()Implementation Notes
!execto the existing!evalfunctionality!evalusageAcceptance Criteria
!execcommand works identically to!eval!evalfunctionalityAdditional Context
This change would help align our tool's terminology with standard Python concepts and reduce confusion for users learning about the differences between
eval()andexec()in Python.