Name | cooleans JSON |
Version |
0.2.0
JSON |
| download |
home_page | |
Summary | Better than booleans |
upload_time | 2024-01-12 14:05:25 |
maintainer | |
docs_url | None |
author | Aymeric Gaillard |
requires_python | >=3.6 |
license | |
keywords |
type
bool
booleans
perhaps
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Cooleans
Cooleans is a Python package that aims to enhance the bool type in Python by adding a new possible value: "perhaps". This is a value that is neither True nor False, but rather may be one of those values. With cooleans, you can more accurately represent situations where the truth value of a statement is uncertain or unknown.
## Getting Started
### Installation
You can install cooleans using pip:
`pip install cooleans`
### Usage
Here's an example of how to use cooleans in Python:
```python
from cooleans import DefinitelyTrue, DefinitelyFalse, Perhaps
my_bool = DefinitelyTrue
if my_bool:
print("This is definitely true")
my_bool = Perhaps
if my_bool >= Perhaps:
print("This might be true")
```
In this example, we create a `DefinitelyTrue` coolean value and use it in an if statement to print "This is definitely true". We then create a Perhaps coolean value and use it in an if statement to print "This might be true". Note that Perhaps will always have a truth value of False when treated as a bool.
### Supported Operators
Cooleans support the same logical operators as normal bools in Python, including:
- `and`
- `or`
- `not`
- `==`
- `!=`
- `<`
- `>`
- `<=`
- `>=`
### Using Values Directly
Cooleans can be used directly as values since they are implemented as a Python class, like so:
```python
from cooleans import DefinitelyTrue, DefinitelyFalse, Perhaps
print(DefinitelyTrue and DefinitelyFalse)
```
This code snippet will output DefinitelyFalse.
## Contributing
We don't welcome contributions to cooleans yet.
## License
This project is licensed under the MIT License - see the LICENSE file for details.
Raw data
{
"_id": null,
"home_page": "",
"name": "cooleans",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "type bool booleans perhaps",
"author": "Aymeric Gaillard",
"author_email": "aymeric.gaillard@protonmail.com",
"download_url": "https://files.pythonhosted.org/packages/ab/ae/1ec6dc6f8798a6ad3a44adb02ea8bd870bd60918eb73db6f7b72bf117caf/cooleans-0.2.0.tar.gz",
"platform": null,
"description": "# Cooleans\r\n\r\nCooleans is a Python package that aims to enhance the bool type in Python by adding a new possible value: \"perhaps\". This is a value that is neither True nor False, but rather may be one of those values. With cooleans, you can more accurately represent situations where the truth value of a statement is uncertain or unknown.\r\n\r\n## Getting Started\r\n\r\n### Installation\r\n\r\nYou can install cooleans using pip: \r\n`pip install cooleans`\r\n\r\n### Usage\r\n\r\nHere's an example of how to use cooleans in Python:\r\n\r\n```python\r\nfrom cooleans import DefinitelyTrue, DefinitelyFalse, Perhaps\r\n\r\nmy_bool = DefinitelyTrue\r\nif my_bool:\r\n print(\"This is definitely true\")\r\n\r\nmy_bool = Perhaps\r\nif my_bool >= Perhaps:\r\n print(\"This might be true\")\r\n```\r\n\r\nIn this example, we create a `DefinitelyTrue` coolean value and use it in an if statement to print \"This is definitely true\". We then create a Perhaps coolean value and use it in an if statement to print \"This might be true\". Note that Perhaps will always have a truth value of False when treated as a bool. \r\n\r\n### Supported Operators\r\n\r\nCooleans support the same logical operators as normal bools in Python, including:\r\n\r\n- `and`\r\n- `or`\r\n- `not`\r\n- `==`\r\n- `!=`\r\n- `<`\r\n- `>`\r\n- `<=`\r\n- `>=`\r\n\r\n### Using Values Directly\r\n\r\nCooleans can be used directly as values since they are implemented as a Python class, like so:\r\n\r\n```python\r\nfrom cooleans import DefinitelyTrue, DefinitelyFalse, Perhaps\r\n\r\nprint(DefinitelyTrue and DefinitelyFalse)\r\n```\r\n\r\nThis code snippet will output DefinitelyFalse. \r\n\r\n## Contributing\r\n\r\nWe don't welcome contributions to cooleans yet. \r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the LICENSE file for details. \r\n",
"bugtrack_url": null,
"license": "",
"summary": "Better than booleans",
"version": "0.2.0",
"project_urls": null,
"split_keywords": [
"type",
"bool",
"booleans",
"perhaps"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "abae1ec6dc6f8798a6ad3a44adb02ea8bd870bd60918eb73db6f7b72bf117caf",
"md5": "105de777212f403f5c74c69f7edbe6ed",
"sha256": "a56eae25e0834c08d290b53ddc99440aac8ffa1bfc0332407d5b96b8ee1eb0b7"
},
"downloads": -1,
"filename": "cooleans-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "105de777212f403f5c74c69f7edbe6ed",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 1826,
"upload_time": "2024-01-12T14:05:25",
"upload_time_iso_8601": "2024-01-12T14:05:25.525775Z",
"url": "https://files.pythonhosted.org/packages/ab/ae/1ec6dc6f8798a6ad3a44adb02ea8bd870bd60918eb73db6f7b72bf117caf/cooleans-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-12 14:05:25",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "cooleans"
}