-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
784 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,154 @@ | ||
asgiref==3.5.2 | ||
astroid==2.12.12 | ||
click==8.1.3 | ||
dill==0.3.6 | ||
Django==4.1.2 | ||
Flask==2.2.2 | ||
isort==5.10.1 | ||
itsdangerous==2.1.2 | ||
Jinja2==3.1.2 | ||
lazy-object-proxy==1.8.0 | ||
MarkupSafe==2.1.1 | ||
mccabe==0.7.0 | ||
platformdirs==2.5.4 | ||
pycodestyle==2.9.1 | ||
pydocstyle==6.1.1 | ||
pylint==2.15.5 | ||
pyobjc==8.5.1 | ||
pyobjc-core==8.5.1 | ||
pyobjc-framework-Accessibility==8.5.1 | ||
pyobjc-framework-Accounts==8.5.1 | ||
pyobjc-framework-AddressBook==8.5.1 | ||
pyobjc-framework-AdServices==8.5.1 | ||
pyobjc-framework-AdSupport==8.5.1 | ||
pyobjc-framework-AppleScriptKit==8.5.1 | ||
pyobjc-framework-AppleScriptObjC==8.5.1 | ||
pyobjc-framework-ApplicationServices==8.5.1 | ||
pyobjc-framework-AppTrackingTransparency==8.5.1 | ||
pyobjc-framework-AudioVideoBridging==8.5.1 | ||
pyobjc-framework-AuthenticationServices==8.5.1 | ||
pyobjc-framework-AutomaticAssessmentConfiguration==8.5.1 | ||
pyobjc-framework-Automator==8.5.1 | ||
pyobjc-framework-AVFoundation==8.5.1 | ||
pyobjc-framework-AVKit==8.5.1 | ||
pyobjc-framework-BusinessChat==8.5.1 | ||
pyobjc-framework-CalendarStore==8.5.1 | ||
pyobjc-framework-CallKit==8.5.1 | ||
pyobjc-framework-CFNetwork==8.5.1 | ||
pyobjc-framework-ClassKit==8.5.1 | ||
pyobjc-framework-CloudKit==8.5.1 | ||
pyobjc-framework-Cocoa==8.5.1 | ||
pyobjc-framework-Collaboration==8.5.1 | ||
pyobjc-framework-ColorSync==8.5.1 | ||
pyobjc-framework-Contacts==8.5.1 | ||
pyobjc-framework-ContactsUI==8.5.1 | ||
pyobjc-framework-CoreAudio==8.5.1 | ||
pyobjc-framework-CoreAudioKit==8.5.1 | ||
pyobjc-framework-CoreBluetooth==8.5.1 | ||
pyobjc-framework-CoreData==8.5.1 | ||
pyobjc-framework-CoreHaptics==8.5.1 | ||
pyobjc-framework-CoreLocation==8.5.1 | ||
pyobjc-framework-CoreMedia==8.5.1 | ||
pyobjc-framework-CoreMediaIO==8.5.1 | ||
pyobjc-framework-CoreMIDI==8.5.1 | ||
pyobjc-framework-CoreML==8.5.1 | ||
pyobjc-framework-CoreMotion==8.5.1 | ||
pyobjc-framework-CoreServices==8.5.1 | ||
pyobjc-framework-CoreSpotlight==8.5.1 | ||
pyobjc-framework-CoreText==8.5.1 | ||
pyobjc-framework-CoreWLAN==8.5.1 | ||
pyobjc-framework-CryptoTokenKit==8.5.1 | ||
pyobjc-framework-DeviceCheck==8.5.1 | ||
pyobjc-framework-DictionaryServices==8.5.1 | ||
pyobjc-framework-DiscRecording==8.5.1 | ||
pyobjc-framework-DiscRecordingUI==8.5.1 | ||
pyobjc-framework-DiskArbitration==8.5.1 | ||
pyobjc-framework-DVDPlayback==8.5.1 | ||
pyobjc-framework-EventKit==8.5.1 | ||
pyobjc-framework-ExceptionHandling==8.5.1 | ||
pyobjc-framework-ExecutionPolicy==8.5.1 | ||
pyobjc-framework-ExternalAccessory==8.5.1 | ||
pyobjc-framework-FileProvider==8.5.1 | ||
pyobjc-framework-FileProviderUI==8.5.1 | ||
pyobjc-framework-FinderSync==8.5.1 | ||
pyobjc-framework-FSEvents==8.5.1 | ||
pyobjc-framework-GameCenter==8.5.1 | ||
pyobjc-framework-GameController==8.5.1 | ||
pyobjc-framework-GameKit==8.5.1 | ||
pyobjc-framework-GameplayKit==8.5.1 | ||
pyobjc-framework-ImageCaptureCore==8.5.1 | ||
pyobjc-framework-IMServicePlugIn==8.5.1 | ||
pyobjc-framework-InputMethodKit==8.5.1 | ||
pyobjc-framework-InstallerPlugins==8.5.1 | ||
pyobjc-framework-InstantMessage==8.5.1 | ||
pyobjc-framework-Intents==8.5.1 | ||
pyobjc-framework-IOSurface==8.5.1 | ||
pyobjc-framework-iTunesLibrary==8.5.1 | ||
pyobjc-framework-KernelManagement==8.5.1 | ||
pyobjc-framework-LatentSemanticMapping==8.5.1 | ||
pyobjc-framework-LaunchServices==8.5.1 | ||
pyobjc-framework-libdispatch==8.5.1 | ||
pyobjc-framework-LinkPresentation==8.5.1 | ||
pyobjc-framework-LocalAuthentication==8.5.1 | ||
pyobjc-framework-MapKit==8.5.1 | ||
pyobjc-framework-MediaAccessibility==8.5.1 | ||
pyobjc-framework-MediaLibrary==8.5.1 | ||
pyobjc-framework-MediaPlayer==8.5.1 | ||
pyobjc-framework-MediaToolbox==8.5.1 | ||
pyobjc-framework-Metal==8.5.1 | ||
pyobjc-framework-MetalKit==8.5.1 | ||
pyobjc-framework-MetalPerformanceShaders==8.5.1 | ||
pyobjc-framework-MetalPerformanceShadersGraph==8.5.1 | ||
pyobjc-framework-MLCompute==8.5.1 | ||
pyobjc-framework-ModelIO==8.5.1 | ||
pyobjc-framework-MultipeerConnectivity==8.5.1 | ||
pyobjc-framework-NaturalLanguage==8.5.1 | ||
pyobjc-framework-NetFS==8.5.1 | ||
pyobjc-framework-Network==8.5.1 | ||
pyobjc-framework-NetworkExtension==8.5.1 | ||
pyobjc-framework-NotificationCenter==8.5.1 | ||
pyobjc-framework-OpenDirectory==8.5.1 | ||
pyobjc-framework-OSAKit==8.5.1 | ||
pyobjc-framework-OSLog==8.5.1 | ||
pyobjc-framework-PassKit==8.5.1 | ||
pyobjc-framework-PencilKit==8.5.1 | ||
pyobjc-framework-Photos==8.5.1 | ||
pyobjc-framework-PhotosUI==8.5.1 | ||
pyobjc-framework-PreferencePanes==8.5.1 | ||
pyobjc-framework-PushKit==8.5.1 | ||
pyobjc-framework-Quartz==8.5.1 | ||
pyobjc-framework-QuickLookThumbnailing==8.5.1 | ||
pyobjc-framework-ReplayKit==8.5.1 | ||
pyobjc-framework-SafariServices==8.5.1 | ||
pyobjc-framework-SceneKit==8.5.1 | ||
pyobjc-framework-ScreenSaver==8.5.1 | ||
pyobjc-framework-ScreenTime==8.5.1 | ||
pyobjc-framework-ScriptingBridge==8.5.1 | ||
pyobjc-framework-SearchKit==8.5.1 | ||
pyobjc-framework-Security==8.5.1 | ||
pyobjc-framework-SecurityFoundation==8.5.1 | ||
pyobjc-framework-SecurityInterface==8.5.1 | ||
pyobjc-framework-ServiceManagement==8.5.1 | ||
pyobjc-framework-Social==8.5.1 | ||
pyobjc-framework-SoundAnalysis==8.5.1 | ||
pyobjc-framework-Speech==8.5.1 | ||
pyobjc-framework-SpriteKit==8.5.1 | ||
pyobjc-framework-StoreKit==8.5.1 | ||
pyobjc-framework-SyncServices==8.5.1 | ||
pyobjc-framework-SystemConfiguration==8.5.1 | ||
pyobjc-framework-SystemExtensions==8.5.1 | ||
pyobjc-framework-UniformTypeIdentifiers==8.5.1 | ||
pyobjc-framework-UserNotifications==8.5.1 | ||
pyobjc-framework-UserNotificationsUI==8.5.1 | ||
pyobjc-framework-VideoSubscriberAccount==8.5.1 | ||
pyobjc-framework-VideoToolbox==8.5.1 | ||
pyobjc-framework-Virtualization==8.5.1 | ||
pyobjc-framework-Vision==8.5.1 | ||
pyobjc-framework-WebKit==8.5.1 | ||
pyttsx3==2.90 | ||
snowballstemmer==2.2.0 | ||
sqlparse==0.4.3 | ||
pip>=22.3 | ||
tomli==2.0.1 | ||
tomlkit==0.11.6 | ||
Werkzeug==2.2.2 | ||
wrapt==1.14.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
# module to explore super object. | ||
|
||
|
||
class A: | ||
"""Class used as base class. | ||
Attributes: | ||
---------- | ||
val (int): Integer class based attribute. | ||
Methods: | ||
-------- | ||
__str__() : Instance overriding string method returning the name of the class. | ||
""" | ||
# class attribute | ||
val = 10 | ||
|
||
def __str__(self) -> str: | ||
"""Returns the name of the class. | ||
Returns: | ||
------- | ||
qualified name of the class as string. | ||
""" | ||
return self.__class__.__qualname__ | ||
|
||
|
||
class B(A): | ||
"""Class deriving from A. | ||
Attributes: | ||
----------- | ||
val (int): Integer class based attribute. | ||
Methods: | ||
-------- | ||
__str__() : Instance overriding string method returning the name of the class. | ||
""" | ||
val = 2 | ||
|
||
def __str__(self) -> str: | ||
"""Returns the name of the class. | ||
Returns: | ||
-------- | ||
The qualified name of the class as a string. | ||
""" | ||
return self.__class__.__qualname__ | ||
|
||
|
||
class C(A): | ||
"""Class deriving from A. | ||
Attributes: | ||
----------- | ||
val (int): Integer class based attribute. | ||
Methods: | ||
-------- | ||
__str__() : Instance overriding string method returning the name of the class. | ||
""" | ||
val = 1 | ||
|
||
def __str__(self) -> str: | ||
"""Returns the name of the class. | ||
Returns: | ||
-------- | ||
The qualified name of the class as a string. | ||
""" | ||
return self.__class__.__qualname__ | ||
|
||
|
||
class X(A): | ||
"""Class deriving from A. | ||
Attributes: | ||
----------- | ||
val (int): Integer class based attribute. | ||
Methods: | ||
-------- | ||
__str__() : Instance overriding string method returning the name of the class. | ||
""" | ||
val = 1 | ||
|
||
def __str__(self) -> str: | ||
"""Returns the name of the class. | ||
Returns: | ||
-------- | ||
The qualified name of the class as a string. | ||
""" | ||
return self.__class__.__qualname__ | ||
|
||
|
||
class Y(X): | ||
"""Class deriving from X. | ||
Attributes: | ||
----------- | ||
val (int): Integer class based attribute. | ||
Methods: | ||
-------- | ||
__str__() : Instance overriding string method returning the name of the class. | ||
""" | ||
val = 3 | ||
|
||
def __str__(self) -> str: | ||
"""Returns the name of the class. | ||
Returns: | ||
-------- | ||
The qualified name of the class as a string. | ||
""" | ||
return self.__class__.__qualname__ | ||
|
||
|
||
class Z(Y, X): | ||
"""Class deriving from Y and X. | ||
Attributes: | ||
----------- | ||
val (int): Integer class based attribute. | ||
Methods: | ||
-------- | ||
__str__() : Instance overriding string method returning the name of the class. | ||
""" | ||
val = 5 | ||
|
||
def __str__(self) -> str: | ||
"""Returns the name of the class. | ||
Returns: | ||
-------- | ||
The qualified name of the class as a string. | ||
""" | ||
return self.__class__.__qualname__ | ||
|
||
|
||
class D(C, Z, B): | ||
"""Class deriving from B and C. | ||
Attributes: | ||
----------- | ||
val (int): Integer class based attribute. | ||
""" | ||
val = 5 | ||
|
||
|
||
|
||
if __name__=="__main__": | ||
a = A() | ||
b = B() | ||
c = C() | ||
d = D() | ||
print("Class:",d) | ||
print(f"Method resolution order: {D.__mro__}") | ||
print(f"Is object of {d} an instance of {a}: {isinstance(b, A)}") | ||
print(f"Is object of {d} a subtype of itself: {issubclass(type(d), D)}") | ||
|
||
_super = super(C, d) | ||
print(f"Type of _super is {_super}, method resolution order: {type(_super).__mro__}") | ||
print(f"The val attribute: {_super.val}") | ||
|
||
_super = super(D, d) | ||
print(f"Type of _super is {_super}, method resolution order: {type(_super).__mro__}") | ||
print(f"The val attribute: {_super.val}") | ||
|
||
_super = super(B, d) | ||
print(f"The type of _super is {_super.__thisclass__}, the object or type of super's second argument is {_super.__self__} and {_super.__self_class__}") | ||
|
||
_super = super(D) | ||
print(f"The type of _super is {_super.__thisclass__}, the object or type of super's second argument is {_super.__self__} and {_super.__self_class__}") | ||
|
||
D.parent = _super | ||
print(f"The type of _super is {d.parent.__thisclass__}, the object or type of super's second argument is {d.parent.__self__} and {d.parent.__self_class__}") |
Oops, something went wrong.