identityfunction 0.0.0.dev0__tar.gz → 1.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: identityfunction
3
- Version: 0.0.0.dev0
3
+ Version: 1.0.1
4
4
  Summary: identityfunction
5
5
  Author-email: Johannes <johannes-programming@mailfence.com>
6
6
  License: The MIT License (MIT)
@@ -27,14 +27,15 @@ License: The MIT License (MIT)
27
27
  Project-URL: Download, https://pypi.org/project/identityfunction/#files
28
28
  Project-URL: Index, https://pypi.org/project/identityfunction/
29
29
  Project-URL: Source, https://github.com/johannes-programming/identityfunction/
30
- Classifier: Development Status :: 1 - Planning
30
+ Project-URL: Website, https://identityfunction.johannes-programming.online/
31
+ Classifier: Development Status :: 5 - Production/Stable
31
32
  Classifier: License :: OSI Approved :: MIT License
32
33
  Classifier: Natural Language :: English
33
34
  Classifier: Operating System :: OS Independent
34
35
  Classifier: Programming Language :: Python
35
36
  Classifier: Programming Language :: Python :: 3
36
37
  Classifier: Programming Language :: Python :: 3 :: Only
37
- Requires-Python: >=3.12.7
38
+ Requires-Python: >=3.8
38
39
  Description-Content-Type: text/x-rst
39
40
  License-File: LICENSE.txt
40
41
 
@@ -42,36 +43,4 @@ License-File: LICENSE.txt
42
43
  identityfunction
43
44
  ================
44
45
 
45
- Overview
46
- --------
47
-
48
- identityfunction
49
-
50
- Installation
51
- ------------
52
-
53
- To install ``identityfunction``, you can use ``pip``. Open your terminal and run:
54
-
55
- .. code-block:: bash
56
-
57
- pip install identityfunction
58
-
59
- License
60
- -------
61
-
62
- This project is licensed under the MIT License.
63
-
64
- Links
65
- -----
66
-
67
- * `Download <https://pypi.org/project/identityfunction/#files>`_
68
- * `Index <https://pypi.org/project/identityfunction/>`_
69
- * `Source <https://github.com/johannes-programming/identityfunction/>`_
70
-
71
- Credits
72
- -------
73
-
74
- * Author: Johannes
75
- * Email: `johannes-programming@mailfence.com <mailto:johannes-programming@mailfence.com>`_
76
-
77
- Thank you for using ``identityfunction``!
46
+ Visit the website `https://identityfunction.johannes-programming.online/ <https://identityfunction.johannes-programming.online/>`_ for more information.
@@ -0,0 +1,5 @@
1
+ ================
2
+ identityfunction
3
+ ================
4
+
5
+ Visit the website `https://identityfunction.johannes-programming.online/ <https://identityfunction.johannes-programming.online/>`_ for more information.
@@ -9,7 +9,7 @@ authors = [
9
9
  { email = "johannes-programming@mailfence.com", name = "Johannes" },
10
10
  ]
11
11
  classifiers = [
12
- "Development Status :: 1 - Planning",
12
+ "Development Status :: 5 - Production/Stable",
13
13
  "License :: OSI Approved :: MIT License",
14
14
  "Natural Language :: English",
15
15
  "Operating System :: OS Independent",
@@ -22,8 +22,8 @@ description = "identityfunction"
22
22
  keywords = []
23
23
  name = "identityfunction"
24
24
  readme = "README.rst"
25
- requires-python = ">=3.12.7"
26
- version = "0.0.0.dev0"
25
+ requires-python = ">=3.8"
26
+ version = "1.0.1"
27
27
 
28
28
  [project.license]
29
29
  file = "LICENSE.txt"
@@ -32,3 +32,4 @@ file = "LICENSE.txt"
32
32
  Download = "https://pypi.org/project/identityfunction/#files"
33
33
  Index = "https://pypi.org/project/identityfunction/"
34
34
  Source = "https://github.com/johannes-programming/identityfunction/"
35
+ Website = "https://identityfunction.johannes-programming.online/"
@@ -1,5 +1,2 @@
1
1
  from identityfunction.core import *
2
2
  from identityfunction.tests import *
3
-
4
- if __name__ == "__main__":
5
- main()
@@ -0,0 +1,8 @@
1
+ from typing import *
2
+
3
+ __all__ = ["identityfunction"]
4
+
5
+
6
+ def identityfunction(value: object, /) -> object:
7
+ "This function returns the value given to it."
8
+ return value
@@ -0,0 +1,53 @@
1
+ import unittest
2
+
3
+ from identityfunction.core import identityfunction
4
+
5
+
6
+ class TestIdentityFunction(unittest.TestCase):
7
+ def test_with_integers(self):
8
+ """Test the identity function with integer values."""
9
+ self.assertEqual(identityfunction(42), 42)
10
+ self.assertEqual(identityfunction(-1), -1)
11
+ self.assertEqual(identityfunction(0), 0)
12
+
13
+ def test_with_strings(self):
14
+ """Test the identity function with string values."""
15
+ self.assertEqual(identityfunction("hello"), "hello")
16
+ self.assertEqual(identityfunction(""), "") # Empty string
17
+
18
+ def test_with_lists(self):
19
+ """Test the identity function with list values."""
20
+ self.assertEqual(identityfunction([1, 2, 3]), [1, 2, 3])
21
+ self.assertEqual(identityfunction([]), []) # Empty list
22
+
23
+ def test_with_dictionaries(self):
24
+ """Test the identity function with dictionary values."""
25
+ self.assertEqual(identityfunction({"key": "value"}), {"key": "value"})
26
+ self.assertEqual(identityfunction({}), {}) # Empty dictionary
27
+
28
+ def test_with_none(self):
29
+ """Test the identity function with None."""
30
+ self.assertIs(identityfunction(None), None)
31
+
32
+ def test_with_custom_objects(self):
33
+ """Test the identity function with custom objects."""
34
+
35
+ class CustomObject:
36
+ pass
37
+
38
+ obj = CustomObject()
39
+ self.assertIs(identityfunction(obj), obj)
40
+
41
+ def test_with_booleans(self):
42
+ """Test the identity function with boolean values."""
43
+ self.assertIs(identityfunction(True), True)
44
+ self.assertIs(identityfunction(False), False)
45
+
46
+ def test_with_floats(self):
47
+ """Test the identity function with float values."""
48
+ self.assertEqual(identityfunction(3.14), 3.14)
49
+ self.assertEqual(identityfunction(-2.718), -2.718)
50
+
51
+
52
+ if __name__ == "__main__":
53
+ unittest.main()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: identityfunction
3
- Version: 0.0.0.dev0
3
+ Version: 1.0.1
4
4
  Summary: identityfunction
5
5
  Author-email: Johannes <johannes-programming@mailfence.com>
6
6
  License: The MIT License (MIT)
@@ -27,14 +27,15 @@ License: The MIT License (MIT)
27
27
  Project-URL: Download, https://pypi.org/project/identityfunction/#files
28
28
  Project-URL: Index, https://pypi.org/project/identityfunction/
29
29
  Project-URL: Source, https://github.com/johannes-programming/identityfunction/
30
- Classifier: Development Status :: 1 - Planning
30
+ Project-URL: Website, https://identityfunction.johannes-programming.online/
31
+ Classifier: Development Status :: 5 - Production/Stable
31
32
  Classifier: License :: OSI Approved :: MIT License
32
33
  Classifier: Natural Language :: English
33
34
  Classifier: Operating System :: OS Independent
34
35
  Classifier: Programming Language :: Python
35
36
  Classifier: Programming Language :: Python :: 3
36
37
  Classifier: Programming Language :: Python :: 3 :: Only
37
- Requires-Python: >=3.12.7
38
+ Requires-Python: >=3.8
38
39
  Description-Content-Type: text/x-rst
39
40
  License-File: LICENSE.txt
40
41
 
@@ -42,36 +43,4 @@ License-File: LICENSE.txt
42
43
  identityfunction
43
44
  ================
44
45
 
45
- Overview
46
- --------
47
-
48
- identityfunction
49
-
50
- Installation
51
- ------------
52
-
53
- To install ``identityfunction``, you can use ``pip``. Open your terminal and run:
54
-
55
- .. code-block:: bash
56
-
57
- pip install identityfunction
58
-
59
- License
60
- -------
61
-
62
- This project is licensed under the MIT License.
63
-
64
- Links
65
- -----
66
-
67
- * `Download <https://pypi.org/project/identityfunction/#files>`_
68
- * `Index <https://pypi.org/project/identityfunction/>`_
69
- * `Source <https://github.com/johannes-programming/identityfunction/>`_
70
-
71
- Credits
72
- -------
73
-
74
- * Author: Johannes
75
- * Email: `johannes-programming@mailfence.com <mailto:johannes-programming@mailfence.com>`_
76
-
77
- Thank you for using ``identityfunction``!
46
+ Visit the website `https://identityfunction.johannes-programming.online/ <https://identityfunction.johannes-programming.online/>`_ for more information.
@@ -4,11 +4,10 @@ README.rst
4
4
  pyproject.toml
5
5
  setup.cfg
6
6
  src/identityfunction/__init__.py
7
- src/identityfunction/__main__.py
8
7
  src/identityfunction.egg-info/PKG-INFO
9
8
  src/identityfunction.egg-info/SOURCES.txt
10
9
  src/identityfunction.egg-info/dependency_links.txt
11
10
  src/identityfunction.egg-info/top_level.txt
12
11
  src/identityfunction/core/__init__.py
13
12
  src/identityfunction/tests/__init__.py
14
- src/identityfunction/tests/test_1984.py
13
+ src/identityfunction/tests/test_0.py
@@ -1,37 +0,0 @@
1
- ================
2
- identityfunction
3
- ================
4
-
5
- Overview
6
- --------
7
-
8
- identityfunction
9
-
10
- Installation
11
- ------------
12
-
13
- To install ``identityfunction``, you can use ``pip``. Open your terminal and run:
14
-
15
- .. code-block:: bash
16
-
17
- pip install identityfunction
18
-
19
- License
20
- -------
21
-
22
- This project is licensed under the MIT License.
23
-
24
- Links
25
- -----
26
-
27
- * `Download <https://pypi.org/project/identityfunction/#files>`_
28
- * `Index <https://pypi.org/project/identityfunction/>`_
29
- * `Source <https://github.com/johannes-programming/identityfunction/>`_
30
-
31
- Credits
32
- -------
33
-
34
- * Author: Johannes
35
- * Email: `johannes-programming@mailfence.com <mailto:johannes-programming@mailfence.com>`_
36
-
37
- Thank you for using ``identityfunction``!
@@ -1,4 +0,0 @@
1
- from identityfunction import main
2
-
3
- if __name__ == "__main__":
4
- main()
@@ -1,2 +0,0 @@
1
- def main(args=None):
2
- print("Hello World!")
@@ -1,10 +0,0 @@
1
- import unittest
2
-
3
-
4
- class Test1984(unittest.TestCase):
5
- def test_1984(self):
6
- self.assertEqual(2 + 2, 4, "Ignorance is Strength")
7
-
8
-
9
- if __name__ == "__main__":
10
- unittest.main()