Compare commits

...

2 Commits

Author SHA1 Message Date
Felföldy Tibor
0031e87db4 Remove docstring; Fix obj.__dir__() 2025-01-26 19:53:08 +01:00
Felföldy Tibor
16e1b7001f Revert "Add fallback to python3 in amalgamate.py"
This reverts commit ddeda78478510cb077df9ed6edb19e19bdd7cf36.
2025-01-26 19:43:32 +01:00
2 changed files with 3 additions and 17 deletions

View File

@ -5,8 +5,7 @@ import sys
import time
from typing import List, Dict
if os.system("python prebuild.py") != 0:
assert os.system("python3 prebuild.py") == 0
assert os.system("python prebuild.py") == 0
ROOT = 'include/pocketpy'
PUBLIC_HEADERS = ['config.h', 'export.h', 'linalg.h', 'pocketpy.h']
@ -157,4 +156,4 @@ if sys.platform in ['linux', 'darwin']:
print("amalgamated/pocketpy.h")
shutil.copy("amalgamated/pocketpy.h", "plugins/flutter/pocketpy/src/pocketpy.h")
shutil.copy("amalgamated/pocketpy.c", "plugins/flutter/pocketpy/src/pocketpy.c")
shutil.copy("amalgamated/pocketpy.c", "plugins/flutter/pocketpy/src/pocketpy.c")

View File

@ -82,24 +82,11 @@ def sorted(iterable, key=None, reverse=False):
return a
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:
return list(globals().keys())
if hasattr(obj, "__dir__"):
return obj.__dir__
return obj.__dir__()
attributes = set()
# Set object attributes.