mirror of
https://github.com/pocketpy/pocketpy
synced 2025-11-08 12:40:17 +00:00
Compare commits
No commits in common. "0031e87db44a9c6e0dbc96e6936f50d428ec5d07" and "dee97fe92a0d24727a2b3fa593c7b261abf23170" have entirely different histories.
0031e87db4
...
dee97fe92a
@ -5,7 +5,8 @@ import sys
|
|||||||
import time
|
import time
|
||||||
from typing import List, Dict
|
from typing import List, Dict
|
||||||
|
|
||||||
assert os.system("python prebuild.py") == 0
|
if os.system("python prebuild.py") != 0:
|
||||||
|
assert os.system("python3 prebuild.py") == 0
|
||||||
|
|
||||||
ROOT = 'include/pocketpy'
|
ROOT = 'include/pocketpy'
|
||||||
PUBLIC_HEADERS = ['config.h', 'export.h', 'linalg.h', 'pocketpy.h']
|
PUBLIC_HEADERS = ['config.h', 'export.h', 'linalg.h', 'pocketpy.h']
|
||||||
|
|||||||
@ -82,11 +82,24 @@ def sorted(iterable, key=None, reverse=False):
|
|||||||
return a
|
return a
|
||||||
|
|
||||||
def dir(obj=None):
|
def dir(obj=None):
|
||||||
|
"""
|
||||||
|
dir([object]) -> list of strings
|
||||||
|
|
||||||
|
If called without an argument, return the names in the current scope.
|
||||||
|
Else, return an alphabetized list of names comprising (some of) the attributes
|
||||||
|
of the given object, and of attributes reachable from it.
|
||||||
|
If the object supplies a method named __dir__, it will be used; otherwise
|
||||||
|
the default dir() logic is used and returns:
|
||||||
|
for a module object: the module's attributes.
|
||||||
|
for a class object: its attributes.
|
||||||
|
for any other object: its attributes, its class's attributes.
|
||||||
|
"""
|
||||||
|
|
||||||
if obj is None:
|
if obj is None:
|
||||||
return list(globals().keys())
|
return list(globals().keys())
|
||||||
|
|
||||||
if hasattr(obj, "__dir__"):
|
if hasattr(obj, "__dir__"):
|
||||||
return obj.__dir__()
|
return obj.__dir__
|
||||||
|
|
||||||
attributes = set()
|
attributes = set()
|
||||||
# Set object attributes.
|
# Set object attributes.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user