Skip to content

Commit

Permalink
Random grammar, spelling and content edits. (#3581)
Browse files Browse the repository at this point in the history
[no important files changed]
  • Loading branch information
BethanyG authored Dec 27, 2023
1 parent dfcb006 commit 185fbdf
Show file tree
Hide file tree
Showing 17 changed files with 161 additions and 163 deletions.
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Our documents use [Markdown][markdown-language], with certain [alterations][exer
- Favor `f-strings` for dynamic failure messages. Please make your error messages as relevant and human-readable as possible.
- We relate test cases to **task number** via a custom [PyTest Marker][pytestmark].
- These take the form of `@pytest.mark.task(taskno=<task-number-here>)`. See [Guido's Gorgeous Lasagna][guidos-gorgeous-lasagna-testfile] for an example.
- We prefer **test data files** when test inputs/ouputs are verbose.
- We prefer **test data files** when test inputs/outputs are verbose.
- These should be named with `_data` or `_test_data` at the end of the filename, and saved alongside the test case file.
- See the [Cater-Waiter][cater-waiter] exercise directory for an example of this setup.
- **Test data files** need to be added under an `editor` key within [`config.json "files"`][exercise-config-json].
Expand Down Expand Up @@ -270,9 +270,9 @@ Although the majority of test cases are written using `unittest.TestCase`,
- [ ] `.meta/config.json` (**required**)
- [ ] `.meta/example.py` (**required**)
- [ ] `.meta/design.md` (_optional_)
- [ ] `.meta/template.j2` (_template for generating tests from cannonical data_)
- [ ] `.meta/tests.toml` (_tests configuration from cannonical data_)
- [ ] `<exercise-slug>_test.py` (_**auto-generated from cannonical data**_)
- [ ] `.meta/template.j2` (_template for generating tests from canonical data_)
- [ ] `.meta/tests.toml` (_tests configuration from canonical data_)
- [ ] `<exercise-slug>_test.py` (_**auto-generated from canonical data**_)
- [ ] `<exericse-slug>.py` (**required**)

</details>
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ Hi. &nbsp;👋🏽 &nbsp;👋 &nbsp;**We are happy you are here.**&nbsp; 🎉&nb
**`exercism/Python`** is one of many programming language tracks on [exercism(dot)org][exercism-website].
This repo holds all the instructions, tests, code, & support files for Python _exercises_ currently under development or implemented & available for students.

🌟 &nbsp;&nbsp;Track exercises support Python `3.7` - `3.11.2`.
🌟 &nbsp;&nbsp;Track exercises support Python `3.7` - `3.11.5`.
Exceptions to this support are noted where they occur.
🌟 &nbsp;&nbsp;Track tooling (_test-runner, representer, analyzer, and Continuous Integration_) runs on Python `3.11.2`.
🌟 &nbsp;&nbsp;Track tooling (_test-runner, representer, analyzer, and Continuous Integration_) runs on Python `3.11.5`.

Exercises are grouped into **concept** exercises which teach the [Python syllabus][python-syllabus], and **practice** exercises, which are unlocked by progressing in the syllabus tree &nbsp;🌴&nbsp;.
Concept exercises are constrained to a small set of language or syntax features.
Expand Down Expand Up @@ -67,7 +67,7 @@ _Thoughtful suggestions will likely result faster & more enthusiastic responses

## Python Software and Documentation

**Copyright © 2001-2022 Python Software Foundation. All rights reserved.**
**Copyright © 2001-2023 Python Software Foundation. All rights reserved.**

Python software and documentation are licensed under the [PSF License Agreement][psf-license].

Expand Down
2 changes: 1 addition & 1 deletion bin/generate_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def parse_datetime(string: str, strip_module: bool = False) -> datetime:
]| # OR
o(?:[0-8]{1,3}) # an octal value
| # OR
x(?:[0-9A-Fa-f]{2}) # a hexidecimal value
x(?:[0-9A-Fa-f]{2}) # a hexadecimal value
| # OR
N # a unicode char name composed of
\{ # an opening brace
Expand Down
7 changes: 2 additions & 5 deletions concepts/binary-octal-hexadecimal/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ As with binary and octal, Python will automatically convert hexadecimal literals
291
```

As with binary and octal - hexidecimal literals **are ints**, and you can perform all integer operations.
Prefixing a non-hexidecimal number with `0x` will raise a `SyntaxError`.
As with binary and octal - hexadecimal literals **are ints**, and you can perform all integer operations.
Prefixing a non-hexadecimal number with `0x` will raise a `SyntaxError`.


### Converting to and from Hexadecimal Representation
Expand All @@ -216,9 +216,6 @@ As with binary and octal, giving the wrong base will raise a `ValueError`.
[binary]: https://en.wikipedia.org/wiki/Binary_number
[bit_count]: https://docs.python.org/3/library/stdtypes.html#int.bit_count
[bit_length]: https://docs.python.org/3/library/stdtypes.html#int.bit_length
[bit_count]: https://docs.python.org/3/library/stdtypes.html#int.bit_count
[bit_length]: https://docs.python.org/3/library/stdtypes.html#int.bit_length
[hexadecimal]: https://en.wikipedia.org/wiki/Hexadecimal
[methods-int]: https://docs.python.org/3/library/stdtypes.html#additional-methods-on-integer-types
[numeral-systems]: https://en.wikipedia.org/wiki/Numeral_system
[octal]: https://en.wikipedia.org/wiki/Octal
2 changes: 1 addition & 1 deletion concepts/binary-octal-hexadecimal/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Binary is base 2, octal is base 8, and hexadecimal is base 16.
Normal integers are base 10 in python.
Binary, octal, and hexadecimal literals are all considered `int` subtypes and Python automatically converts between them.
This means that they can only represent zero, positive, and negative numbers that do not have a fractional or decimal part.
Binary, octal, and hexidecimal numbers support all integer operations.
Binary, octal, and hexadecimal numbers support all integer operations.
However, division (_as with ints_) will return a `float`.

[numeral-systems]: https://en.wikipedia.org/wiki/Numeral_system
2 changes: 1 addition & 1 deletion concepts/classes/links.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
{
"url": "https://dbader.org/blog/6-things-youre-missing-out-on-by-never-using-classes-in-your-python-code",
"description": "6 Things Youre Missing out on by never using classes in your Python code."
"description": "6 Things You are Missing out on by never using classes in your Python code."
},
{
"url": "http://python-history.blogspot.com/2010/06/inside-story-on-new-style-classes.html",
Expand Down
8 changes: 4 additions & 4 deletions concepts/conditionals/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ else:
>>> z is greater than x and y
```

[Boolen operations][boolean operations] and [comparisons][comparisons] can be combined with conditionals for more complex testing:
[Boolean operations][boolean operations] and [comparisons][comparisons] can be combined with conditionals for more complex testing:

```python

Expand All @@ -77,8 +77,8 @@ else:
'13'
```

[if statement]: https://docs.python.org/3/reference/compound_stmts.html#the-if-statement
[control flow tools]: https://docs.python.org/3/tutorial/controlflow.html#more-control-flow-tools
[truth value testing]: https://docs.python.org/3/library/stdtypes.html#truth-value-testing
[boolean operations]: https://docs.python.org/3/library/stdtypes.html#boolean-operations-and-or-not
[comparisons]: https://docs.python.org/3/library/stdtypes.html#comparisons
[control flow tools]: https://docs.python.org/3/tutorial/controlflow.html#more-control-flow-tools
[if statement]: https://docs.python.org/3/reference/compound_stmts.html#the-if-statement
[truth value testing]: https://docs.python.org/3/library/stdtypes.html#truth-value-testing
2 changes: 1 addition & 1 deletion concepts/function-arguments/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ For the basics on function arguments, please see the [function concept][function

## Parameter Names

Paramater names, like variable names, must start with a letter or underscore and may contain letters, underscores, or numbers.
Parameter names, like variable names, must start with a letter or underscore and may contain letters, underscores, or numbers.
Parameter names should not contain spaces or punctuation.

## Positional Arguments
Expand Down
2 changes: 1 addition & 1 deletion concepts/function-arguments/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ For the basics on function arguments, please see the [function concept][function

## Parameter Names

Paramater names, like variable names, must start with a letter or underscore and may contain letters, underscores, or numbers.
Parameter names, like variable names, must start with a letter or underscore and may contain letters, underscores, or numbers.
Parameter names should not contain spaces or punctuation.

## Positional Arguments
Expand Down
6 changes: 3 additions & 3 deletions concepts/functions/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

A [`function`][function] is a block of organized, reusable code that is used to perform a specific task.
`Functions` provide better modularity for your application and a high degree of code reuse.
Python, like other programming languages, has [_built-in functions_][build-in functions] ([`print`][print], [`map`][map], and so on) that are readily available.
Python, like other programming languages, has [_built-in functions_][built-in functions] ([`print`][print], [`map`][map], and so on) that are readily available.
You can also define your own functions. Those are called [`user-defined functions`][user defined functions].
Functions can run something as simple as _printing a message to the console_ or they can be quite complex.

To execute the code inside a function, you need to call the function, which is done by using the function name followed by parenthesese [`()`].
To execute the code inside a function, you need to call the function, which is done by using the function name followed by parentheses [`()`].
Data, known as [`arguments`][arguments], can be passed to the function by placing them inside the parenthesese.
A function definition may include zero or more [`parameters`][parameters].
Parameters define what argument(s) the function accepts.
Expand Down Expand Up @@ -376,7 +376,7 @@ The full list of function attributes can be found at [Python DataModel][attribut
[LEGB Rule]: https://realpython.com/python-scope-legb-rule/
[arguments]: https://www.w3schools.com/python/gloss_python_function_arguments.asp
[attributes]: https://docs.python.org/3/reference/datamodel.html#index-33
[build-in functions]: https://docs.python.org/3/library/functions.html
[built-in functions]: https://docs.python.org/3/library/functions.html
[def]: https://www.geeksforgeeks.org/python-def-keyword/
[dict]: https://docs.python.org/3/tutorial/datastructures.html#dictionaries
[first class objects]: https://en.wikipedia.org/wiki/First-class_object
Expand Down
21 changes: 11 additions & 10 deletions concepts/functools/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The functools module is for higher-order functions: functions that act on or ret

Since a dictionary is used to cache results, the positional and keyword arguments to the function must be hashable.

Here ```maxsize = 128``` means that it is going to memoize lastest 128 function calls at max.
Here ```maxsize = 128``` means that it is going to memoize latest 128 function calls at max.

The lru_cache works the same way but it can cache at max maxsize calls and if type = True, then the function arguments of different types will be cached separately i.e. 5 and 5.0 will be cached differently.

Expand All @@ -23,8 +23,8 @@ The lru_cache works the same way but it can cache at max maxsize calls and if ty
```python

>>> @cache
def factorial(n):
return n * factorial(n-1) if n else 1
>>> def factorial(n):
>>> return n * factorial(n-1) if n else 1

>>> factorial(10) # no previously cached result, makes 11 recursive calls
3628800
Expand All @@ -37,9 +37,10 @@ The lru_cache works the same way but it can cache at max maxsize calls and if ty

# Some types such as str and int may be cached separately even when typed is false.

@lru_cache(maxsize = 128)
def factorial(n):
return n * factorial(n-1) if n else 1
>>> @lru_cache(maxsize = 128)
>>> def factorial(n):
>>> return n * factorial(n-1) if n else 1

>>> factorial(10)
3628800

Expand All @@ -50,7 +51,7 @@ CacheInfo(hits=0, misses=11, maxsize=128, currsize=11)

## Generic functions

***[Generic functions](https://pymotw.com/3/functools/#generic-functions)*** are those which preform the operation based on the argument given to them. In statically typed languages it can be done by function overloading.
***[Generic functions](https://pymotw.com/3/functools/#generic-functions)*** are those which perform the operation based on the argument given to them. In statically typed languages it can be done by function overloading.

In python functools provides the `singledispatch()` decorator to register a set of generic functions for automatic switching based on the type of the first argument to a function.

Expand Down Expand Up @@ -193,11 +194,11 @@ True

The ```pow_2.func``` is same as the ```pow``` function.

Here ```pow_2.args``` return an empty tuple becuse we does not pass any positional argument to out partial object call.
Here ```pow_2.args``` returns an empty tuple because we do not pass any positional argument to our partial object call.

```pow_2.keywords``` return a dictionary of keywords argument which will be supplied when the partial object is called.
```pow_2.keywords``` returns a dictionary of keywords argument which will be supplied when the partial object is called.

Here ```two_pow.args``` return an ```(2,)``` tuple because we passed 2 as an argument while creating the pratial object, which fixed the value of ```base``` argument as ```2```.
Here ```two_pow.args``` returns a ```(2,)``` tuple because we passed 2 as an argument while creating the partial object, which fixed the value of ```base``` argument as ```2```.

### ```partialmethod```

Expand Down
2 changes: 1 addition & 1 deletion concepts/functools/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The functools module is for higher-order functions: functions that act on or ret

Since a dictionary is used to cache results, the positional and keyword arguments to the function must be hashable.

Here ```maxsize = 128``` means that it is going to memoize lastest 128 function calls at max.
Here ```maxsize = 128``` means that it is going to memoize latest 128 function calls at max.

### ```@functools.cache(user_function)```

Expand Down
4 changes: 2 additions & 2 deletions docs/TRACEBACKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ def halve_and_quadruple(num):
print((num / 2) * 4)
return (num / 2) * 4

What the `print` calls revealed is that we used `/` when we should have used `//`, the [floor divison operator][floor divison operator].
What the `print` calls revealed is that we used `/` when we should have used `//`, the [floor division operator][floor division operator].

## Logging

Expand Down Expand Up @@ -487,7 +487,7 @@ AssertionError: divisor must not be 0

```

If we start reading the Traceback at the bottom (as we should) we quickly see the problem is that `0` should not be passsed as the `divisor`.
If we start reading the Traceback at the bottom (as we should) we quickly see the problem is that `0` should not be passed as the `divisor`.

`assert` can also be used to test that a value is of the expected type:

Expand Down
2 changes: 1 addition & 1 deletion exercises/concept/ellens-alien-game/classes_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ClassesTest(unittest.TestCase):

@pytest.mark.task(taskno=1)
def test_alien_has_correct_initial_coordinates(self):
"""Test thst the Alien class gets correctly initialised."""
"""Test that the Alien class gets correctly initialised."""

alien = Alien(2, -1)
error_message = (f'Created a new Alien by calling Alien(2, -1). '
Expand Down
4 changes: 2 additions & 2 deletions exercises/concept/locomotive-engineer/locomotive_engineer.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ def get_list_of_wagons():
def fix_list_of_wagons(each_wagons_id, missing_wagons):
"""Fix the list of wagons.
:parm each_wagons_id: list - the list of wagons.
:parm missing_wagons: list - the list of missing wagons.
:param each_wagons_id: list - the list of wagons.
:param missing_wagons: list - the list of missing wagons.
:return: list - list of wagons.
"""
pass
Expand Down
4 changes: 2 additions & 2 deletions reference/concept-exercise-mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -398,14 +398,14 @@ _Concepts needed for a deeper understanding/fluency_

## Specialized

_(These are probably outside scope of an Exercism Concept exercise, but might make good longer/practice exercises that recieve mentoring)_
_(These are probably outside scope of an Exercism Concept exercise, but might make good longer/practice exercises that receive mentoring)_

<details>
<summary> Advanced/Specialized Concepts
<br>
</summary>

- [ ] Asynchronous operatons
- [ ] Asynchronous operations
- [ ] [`async`][keyword-async]
- [ ] [`await`][keyword-await]

Expand Down
Loading

0 comments on commit 185fbdf

Please sign in to comment.