potassco / potassco/constraint-handler
Conventions for python names
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3
- Forks
- 0
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 20
Description
By default, we should strive to follow PEP8 :
- Class names should normally use the CapWords convention
- Function and method names should be lowercase, with words separated by underscores
- Variable names follow the same convention as function names
The above conventions do not apply to functions and classes that interface with ASP:
- functions that are called from asp
-
- start with
python
- start with
-
- use mixed case
-
- are located in a
#script (python)section of some.lpfile
- are located in a
- asp predicates or function symbol of arity zero
-
- are typically member of an enumeration class
-
- are uncapitalized
-
- use the same name as the corresponding asp name
-
- use that name for the enumeration member whenever possible
- classes that correspond to asp predicates or function symbol of non-zero arity
-
- typically derive from
NamedTuple
- typically derive from
-
- start with an uppercase letter
-
- using the same name as the corresponding asp name (the capitalization of the first letter notwithstanding)
Examples:
evaluate_expris function that is not interfacing with asppythonEvalExpris an interface function- the python class
Set_valuederives fromNamedTupleand has 3 attributes. It corresponds to the aspset_value/3predicate; - the enumeration member
SetOperator.foldcorresponds to the aspfoldpredcate. Its name is"fold"
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or entry points are named. First inspect the repository's Python sources and determine whether the conventions are intended to be documented or applied across existing code. The issue does not define a verifiable done state.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- developer-experience
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100