Skip to content

Commit 4675c4d

Browse files
committed
classes
1 parent 91151c2 commit 4675c4d

10 files changed

+32
-2
lines changed

classes/Inheritance.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
class Main:
2+
def __init__(self):
3+
self.name = "John"
4+
self.size = 100
5+
6+
7+
class SeekAttr(Main):
8+
def __init__(self):
9+
super().__init__()
10+
11+
12+
if __name__ == '__main__':
13+
main = Main()
14+
15+
print(main.name, main.size)
16+
17+
seek = SeekAttr()
18+
19+
print(seek.name, seek.size)
File renamed without changes.
File renamed without changes.

classes/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Main:
2+
def __init__(self):
3+
self.name = "John"
4+
self.size = 100
5+
6+
7+
if __name__ == '__main__':
8+
main = Main()
9+
10+
print(main.name, main.size)
File renamed without changes.

classes/classes.drawio

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<mxfile host="drawio-plugin" modified="2023-05-28T22:32:01.998Z" agent="5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.102 Safari/537.36" etag="cfzkm9_AOl370l_WKFSt" version="20.5.3" type="embed"><diagram id="-D-LmLzfiopcx7tQNFET" name="Classes"><mxGraphModel dx="1087" dy="655" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0"><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="2" value="Magic Methods" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"><mxGeometry x="210" y="660" width="120" height="60" as="geometry"/></mxCell><mxCell id="4" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="3" target="2" edge="1"><mxGeometry relative="1" as="geometry"><Array as="points"><mxPoint x="270" y="580"/></Array></mxGeometry></mxCell><mxCell id="3" value="__init__" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"><mxGeometry x="50" y="550" width="120" height="60" as="geometry"/></mxCell><mxCell id="6" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="5" target="2" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="5" value="__getattr__" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"><mxGeometry x="50" y="480" width="120" height="60" as="geometry"/></mxCell><mxCell id="8" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="7" target="2" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="7" value="__enter__" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"><mxGeometry x="50" y="410" width="120" height="60" as="geometry"/></mxCell><mxCell id="14" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="13" target="2" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="13" value="__next__" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"><mxGeometry x="50" y="340" width="120" height="60" as="geometry"/></mxCell><mxCell id="65" style="edgeStyle=elbowEdgeStyle;shape=connector;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;labelBackgroundColor=default;strokeColor=default;fontFamily=Helvetica;fontSize=11;fontColor=default;endArrow=classic;" parent="1" source="15" target="57" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="4iZPyKypYhyyQiJqHdgi-65" style="edgeStyle=elbowEdgeStyle;shape=connector;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;labelBackgroundColor=default;strokeColor=default;fontFamily=Helvetica;fontSize=11;fontColor=default;endArrow=classic;" parent="1" source="15" target="43" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="4iZPyKypYhyyQiJqHdgi-69" style="edgeStyle=elbowEdgeStyle;shape=connector;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;labelBackgroundColor=default;strokeColor=default;fontFamily=Helvetica;fontSize=11;fontColor=default;endArrow=classic;" parent="1" source="15" target="21" edge="1"><mxGeometry relative="1" as="geometry"><Array as="points"><mxPoint x="350" y="880"/></Array></mxGeometry></mxCell><mxCell id="4iZPyKypYhyyQiJqHdgi-70" style="edgeStyle=elbowEdgeStyle;shape=connector;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.75;entryY=1;entryDx=0;entryDy=0;labelBackgroundColor=default;strokeColor=default;fontFamily=Helvetica;fontSize=11;fontColor=default;endArrow=classic;" parent="1" source="15" target="2" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="15" value="Classes" style="rounded=0;whiteSpace=wrap;html=1;shadow=0;" parent="1" vertex="1"><mxGeometry x="230" y="950" width="170" height="100" as="geometry"/></mxCell><mxCell id="23" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="21" target="22" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="25" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="21" target="24" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="549.9411764705883" y="499.9999999999998" as="targetPoint"/></mxGeometry></mxCell><mxCell id="21" value="Encapsulation" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"><mxGeometry x="390" y="550" width="120" height="60" as="geometry"/></mxCell><mxCell id="22" value="Private" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"><mxGeometry x="350" y="440" width="120" height="60" as="geometry"/></mxCell><mxCell id="24" value="Protect" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"><mxGeometry x="490" y="440" width="120" height="60" as="geometry"/></mxCell><mxCell id="54" style="edgeStyle=none;shape=connector;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;labelBackgroundColor=default;strokeColor=default;fontFamily=Helvetica;fontSize=11;fontColor=default;endArrow=classic;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="640" y="735.9999999999998" as="sourcePoint"/><mxPoint x="640" y="735.9999999999998" as="targetPoint"/></mxGeometry></mxCell><mxCell id="4iZPyKypYhyyQiJqHdgi-73" style="edgeStyle=elbowEdgeStyle;shape=connector;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.25;entryDx=0;entryDy=0;labelBackgroundColor=default;strokeColor=default;fontFamily=Helvetica;fontSize=11;fontColor=default;endArrow=classic;" parent="1" source="28" target="37" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="4iZPyKypYhyyQiJqHdgi-74" style="edgeStyle=elbowEdgeStyle;shape=connector;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;labelBackgroundColor=default;strokeColor=default;fontFamily=Helvetica;fontSize=11;fontColor=default;endArrow=classic;" parent="1" source="28" target="34" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="28" value="Property" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"><mxGeometry x="520" y="700" width="120" height="60" as="geometry"/></mxCell><mxCell id="34" value="@property" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"><mxGeometry x="720" y="730" width="120" height="60" as="geometry"/></mxCell><mxCell id="37" value="@attr.setter" style="rounded=0;whiteSpace=wrap;html=1;direction=west;glass=0;shadow=0;sketch=0;" parent="1" vertex="1"><mxGeometry x="720" y="660" width="120" height="60" as="geometry"/></mxCell><mxCell id="46" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="43" target="28" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="43" value="Attributes" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"><mxGeometry x="440" y="820" width="120" height="60" as="geometry"/></mxCell><mxCell id="57" value="Inheritance" style="rounded=0;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontSize=11;fontColor=default;" parent="1" vertex="1"><mxGeometry x="70" y="790" width="120" height="50" as="geometry"/></mxCell></root></mxGraphModel></diagram></mxfile>
File renamed without changes.
File renamed without changes.

database/ORM/SQLAlchemy/sqlalchemy_exemple.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
class Base(DeclarativeBase):
7-
"""Base class for all tables"""
7+
"""Base classes for all tables"""
88
pass
99

1010

database/ORM/SQLAlchemy/sqlalchemy_exemple_advanced.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
class Base(DeclarativeBase):
7-
"""Base class for all tables"""
7+
"""Base classes for all tables"""
88
pass
99

1010

0 commit comments

Comments
 (0)