Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
satella
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
public
satella
Commits
193d13e3
Commit
193d13e3
authored
4 years ago
by
Piotr Maślanka
Browse files
Options
Downloads
Patches
Plain Diff
docs fixed a bit
parent
cffe9c8f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/coding/predicates.rst
+4
-10
4 additions, 10 deletions
docs/coding/predicates.rst
satella/coding/predicates.py
+1
-1
1 addition, 1 deletion
satella/coding/predicates.py
with
5 additions
and
11 deletions
docs/coding/predicates.rst
+
4
−
10
View file @
193d13e3
...
...
@@ -18,17 +18,11 @@ Satella lets you express lambdas in a Pythonic way, eg:
assert(p(2) and not p(1))
This behaviour extends to operators, item procurement and attr procurement. The only exception is the length,
which due to Python limitations (namely __len__ being allowed to return an int only) is called
via it's method .length(), eg:
::
p = x.length() == 2
assert(p([1, 2]) and not p([3])
This behaviour extends to operators, item procurement and attr procurement.
The only exceptions are operator subject to Python limitations (ie.
__len__ being allowed to return an int only for example) is called.
These are mentioned in the docs below.
You can also piece together multiple predicates.
Because of Python limitations please use & and | operators in place of and and or.
...
...
This diff is collapsed.
Click to expand it.
satella/coding/predicates.py
+
1
−
1
View file @
193d13e3
...
...
@@ -116,7 +116,7 @@ class Predicate:
"""
Check if given value has the correct schema.
The schema is the same as in
:py:meth:`satella.coding.structures.DictObject.is_valid_schema`
:py:meth:`
~
satella.coding.structures.DictObject.is_valid_schema`
"""
def
is_schema_correct
(
v
):
return
DictObject
(
self
.
operation
(
v
)).
is_valid_schema
(
schema
,
**
kwargs
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment