From 14dbd3ed39329fe154610a2d4cc5d31aab810920 Mon Sep 17 00:00:00 2001 From: cheezedoodle2 Date: Wed, 7 Jun 2023 18:57:24 -0700 Subject: [PATCH 1/2] Removed bytecode that caused problems during testing https://gogs.gtsplab.com:5432/SVIG/python-bootcamp/wiki/6-7-2023+Cohort+2+Sync+Notes --- .../__pycache__/BoundedInt.cpython-311.pyc | Bin 2769 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 Scott_Submissions/__pycache__/BoundedInt.cpython-311.pyc diff --git a/Scott_Submissions/__pycache__/BoundedInt.cpython-311.pyc b/Scott_Submissions/__pycache__/BoundedInt.cpython-311.pyc deleted file mode 100644 index 398423514836d02df04ba5bc0e33270557d80c66..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2769 zcmcf@O=}xRbao|KYkgF%lq#l8(hV_13dHKE4xtoe$AnzmP&=jgvaB`Zcx!7{of)~d z5XCK_xZp!?cEJH3OxoZcdMGr9{0J%N5Egt2y{otZNkXBLdm>Jm4{?LL{-3H8Uh@lVZcK)0v3kc*rZdnDWi97S?YO5L+C36zoYj7 zZIilECk9X*sH?#B{E>PHI6pS3fL*orGNyN7iZfF(-P9L4o^;EW>;dEBG5<)BKM=Qk z4)rWO2gmZa^tmMl3YN6Y6@ArQsWRPJ)TJlvTIu=0wQSjgiojasYWXaR=GqBGbL|X@ zGx?CKSZ)a105aF|VK*$;$|8?InmE*!@F*aGdBy0C?-uS0#zjGt94QO8nOK%irEq6% z_Fkc~E|(np#)9L>l3A`4X7PwITU{tyLRgM13jIQjSJqw4Ffc8KQOgW$^n_RqaT(AC zX{Sj#vl-qRdXdS(qIH)|ZBsjf1El2F5g4Sss*eBxRVSar+5xDlQmgqznsV$_#-&$^ zKw)+1V2uar`w5d(ZU;+j%T9Sulr>;$+;^B)ytKliK|lf{)%h@BH;P}4nMemR0kRaH zjRS&2yg^1TY^`o4Ir1gHVS&MVd7r%tX19qPNJ(9h11C?8A^#W>Mv?w`Py2P2F=7t}y*vi}1K-AM@H-Mc9YO-%F@5qo&O7?9 zy|cxP73%_3gBi+)W@=Z8l)`=B*g9J)F-CloSx?HcY zyynI%Vc9~Oc8PIJRA*9gNZr_{c)LtUtw} z{V=OHt`?iw$yRo-fLt2$6>h&FNox3>Eyf& zK8qY}!|C8@L>WXE00p~WR2NQlzb6~R!~dfDZ#T2kt?YDTWcu8? z{}m?B*!?s4C_cBgS!Rae#tftE(CP}(3B&lJYOZv4I24ZXB%&-Loct%mn;-9;>LeF$ z9lY|zJwO}&Ut5hwF1Cq}-i}7HZQ`SJEON6=d^GA)eHl_6XXs)E-bwF*y97)>hGXr+ jPVgUb{O`aEWCDnGNKurwdP4y(r_moM`|}kWp5ea$bF@h< From d2bb4dc72af2f07c0d2bda1ccb113809383cc4d3 Mon Sep 17 00:00:00 2001 From: "scott.liu" Date: Tue, 13 Jun 2023 03:40:53 -0700 Subject: [PATCH 2/2] Updates on the notes of 3.1 and 3.2 --- Scott_Submissions/Reading_Material_Notes.rtf | 82 ++++++++++++++++++-- 1 file changed, 74 insertions(+), 8 deletions(-) diff --git a/Scott_Submissions/Reading_Material_Notes.rtf b/Scott_Submissions/Reading_Material_Notes.rtf index e46f600..363589f 100644 --- a/Scott_Submissions/Reading_Material_Notes.rtf +++ b/Scott_Submissions/Reading_Material_Notes.rtf @@ -1,16 +1,17 @@ {\rtf1\ansi\ansicpg1252\cocoartf2580 -\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 LucidaGrande-Bold;\f1\fnil\fcharset0 LucidaGrande;} -{\colortbl;\red255\green255\blue255;\red26\green26\blue26;\red255\green255\blue255;} -{\*\expandedcolortbl;;\cssrgb\c13333\c13333\c13333;\cssrgb\c100000\c100000\c100000;} -\margl1440\margr1440\vieww11520\viewh8400\viewkind0 +\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red26\green26\blue26;\red255\green255\blue255;\red39\green40\blue50; +} +{\*\expandedcolortbl;;\cssrgb\c13333\c13333\c13333;\cssrgb\c100000\c100000\c100000;\cssrgb\c20392\c20784\c25490; +} +\margl1440\margr1440\vieww28300\viewh17700\viewkind0 \deftab720 \pard\pardeftab720\parhyphenfactor20\partightenfactor0 -\f0\b\fs32 \cf2 \cb3 \expnd0\expndtw0\kerning0 -CPython implementation detail: -\f1\b0 CPython currently uses a reference-counting scheme with (optional) delayed detection of cyclically linked garbage, which collects most objects as soon as they become unreachable, but is not guaranteed to collect garbage containing circular references.\ +\f0\fs32 \cf2 \cb3 \expnd0\expndtw0\kerning0 +CPython implementation detail: CPython currently uses a reference-counting scheme with (optional) delayed detection of cyclically linked garbage, which collects most objects as soon as they become unreachable, but is not guaranteed to collect garbage containing circular references.\ \ - What is a r\cf2 eference-counting scheme?\ + What is a reference-counting scheme?\ It refers to a memory management technique where each object in a programming language implementation, such as CPython, keeps track of the number of references pointing to it. \ Whenever a reference is created to an object, its reference count is increased, and when a reference is deleted or goes out of scope, the reference count is decreased. \ \ @@ -48,4 +49,69 @@ What is the advantages of the dunder method?\ \ \ \ +What is a Von Neumann\'92s model of a \'93stored program computer\'94?\ + Von Neumann's model of a "stored program computer" is a fundamental concept in computer architecture that describes the organization and operation of modern digital computers.\ + It describes a computer architecture where instructions and data are stored together in memory, enabling the execution of instructions as data, and forming the basis of programmable digital computers.\ + The distinguishing feature of Von Neumann's model is that both data and instructions are stored in the same memory. This means that the instructions that govern the computer's operations can be treated as data and manipulated like any other type of information. This concept, known as the "stored program concept," allows for the flexibility and programmability of modern computers.\ +\ +\ +\ +\pard\pardeftab720\partightenfactor0 +\cf4 \cb1 What is the difference between identity and type?\ + Identity: \ + The identity of an object is a unique identifier that remains constant throughout the object's lifetime. \ + It can be thought of as the object's address in memory. \ + Python provides a built-in function called id() that returns an integer representing the identity of an object. \ + The identity never changes once the object is created, and no two objects can have the same identity at the same time.\ + Type: \ + The type of an object defines the category or class to which the object belongs. \ + It determines the behavior of the object and the operations that can be performed on it. \ + In Python, the type of an object is determined by its class, which defines the object's characteristics and behavior. \ + The type of an object can be obtained using the type() function.\ + \ + To summarize, the identity of an object is a unique identifier associated with its memory location, while the type of an object defines its category or class, determining its behavior and the operations that can be performed on it.\ +\ +\ +\ +The important distinction between immutability and having an unchangeable value in the context of container objects that reference mutable objects in Python.\ + In Python, immutability refers to the property of an object that prevents its internal state or structure from being modified after it is created. Immutable objects, such as integers, strings, and tuples, cannot be changed once they are created. However, when an immutable container object (like a tuple or a frozenset) contains a reference to a mutable object (such as a list or a set), the value of the mutable object can be modified even though the container object itself cannot be changed.\ + So, while the value of the mutable object can be altered, the container object is still considered immutable because its internal structure (the collection of objects it contains) cannot be changed. The container object cannot be modified to add, remove, or replace elements, but the mutable object it references can be modified independently.\ + Therefore, the concept of immutability is more subtle than simply having an unchangeable value. It refers to the inability to modify the structure or internal state of an object, but it doesn't necessarily guarantee that all the objects referenced by an immutable container are themselves immutable.\ +\ +\ +\ +What is a close() method in Python?\ + The close() method is typically invoked on an object representing the file or resource. \ + Calling the close() method can release the associated system resources and ensure that any buffered data is written to the disk.\ + \ + It's important to note that closing a file or resource is good practice to free up system resources and prevent any potential issues. Failing to close resources properly can result in resource leaks and may lead to unexpected behavior in your program.\ +\ +\ +\ +\'93try...finally\'94 statement:\ + The try...finally statement is used to ensure that certain code is always executed, regardless of whether an exception occurs or not. \ + The code within the try block is executed, and if an exception occurs, it can be caught and handled using an appropriate except block. After the try block (and any associated except blocks), the code within the finally block is executed, ensuring that it always runs, regardless of exceptions. This is useful for cleaning up resources or releasing locks, even if an exception occurs.\cf2 \cb3 \ +\pard\pardeftab720\parhyphenfactor20\partightenfactor0 +\cf2 \ +\ +\ +\'93with\'94 statement:\ + The with statement provides automatic resource management, improves code readability, handles exceptions effectively, and allows for the creation of custom context managers. It is a recommended approach for managing resources that need proper initialization and cleanup, such as files, database connections, network sockets, and more. By using the with statement, you can ensure that your code is more robust, maintainable, and less prone to resource leaks and error handling issues.\ +\ +\ +\ +What is a container?\ + A container refers to an object that can hold multiple other objects or values. \ + Examples of containers in Python include tuples, lists, dictionaries, sets, and other collection types.\ + Containers are used to store and organize multiple objects or values together. They provide a way to group related data and operate on them as a whole. \ +\ +\ +\ +What is a type hierarchy?\ + The type hierarchy in Python refers to the organization and relationships among different types or classes in the Python programming language. \ + It defines how types are related to each other and how they inherit attributes and behaviors from their parent types.\ + the type hierarchy in Python provides a structured organization of types, allowing for code reuse, inheritance, and polymorphism, which are fundamental principles of object-oriented programming.\ +\ + \ +\ ## The attached file HW7_test.py provides an example on how dunder method works. Don\'92t forget to check it out.} \ No newline at end of file