From 6afff08204e3096b82102a8fa5c6be5b6174e4d1 Mon Sep 17 00:00:00 2001 From: alwenpy Date: Tue, 4 Oct 2022 12:19:54 +0530 Subject: [PATCH 1/2] added method overloading in python documentation --- Examples/method_overloading.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Examples/method_overloading.py diff --git a/Examples/method_overloading.py b/Examples/method_overloading.py new file mode 100644 index 0000000..3cdd4fd --- /dev/null +++ b/Examples/method_overloading.py @@ -0,0 +1,29 @@ +""" +Method Overloading allows different methods to have the same name, +but different signatures where the signature can differ by the number of +input parameters or type of input parameters, or a mixture of both. +Method overloading is also known as Compile-time Polymorphism, Static Polymorphism, or Early binding in Java. +In Method overloading compared to parent argument, child argument will get the highest priority. +Below is an example which demonstrates method overloading +""" + + +# First product method. +# Takes two argument and print their +# product +def product(a, b): + p = a * b + print(p) + +# Second product method +# Takes three argument and print their +# product +def product(a, b, c): + p = a * b*c + print(p) + +# Uncommenting the below line shows an error +# product(4, 5) + +# This line will call the second product method +product(4, 5, 5) From 82aca57beba94eb2b37e5b42b6f019b91d53bbcf Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Sat, 25 Feb 2023 16:08:03 +0000 Subject: [PATCH 2/2] fix: Examples/sample_oo_dashboard/requirements_dashboard.txt to reduce vulnerabilities The following vulnerabilities are fixed by pinning transitive dependencies: - https://snyk.io/vuln/SNYK-PYTHON-FUTURE-3180414 - https://snyk.io/vuln/SNYK-PYTHON-JINJA2-1012994 - https://snyk.io/vuln/SNYK-PYTHON-PYGMENTS-1086606 - https://snyk.io/vuln/SNYK-PYTHON-PYGMENTS-1088505 --- Examples/sample_oo_dashboard/requirements_dashboard.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Examples/sample_oo_dashboard/requirements_dashboard.txt b/Examples/sample_oo_dashboard/requirements_dashboard.txt index 5ac0c68..5849ae6 100644 --- a/Examples/sample_oo_dashboard/requirements_dashboard.txt +++ b/Examples/sample_oo_dashboard/requirements_dashboard.txt @@ -13,10 +13,10 @@ Faker==0.8.18 flake8==3.7.8 Flask==1.1.1 Flask-Compress==1.4.0 -future==0.17.1 +future==0.18.3 inflection==0.3.1 itsdangerous==1.1.0 -Jinja2==2.10.1 +Jinja2==2.11.3 lazy-object-proxy==1.4.2 MarkupSafe==1.1.1 mccabe==0.6.1 @@ -27,7 +27,7 @@ plotly==4.1.1 pyaml==16.12.2 pycodestyle==2.5.0 pyflakes==2.1.1 -Pygments==2.4.2 +Pygments==2.7.4 pylev==1.3.0 python-dateutil==2.8.0 pytz==2019.2