Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add glob! and resolve! Methods in Pathlib.d.er #526

Merged
merged 3 commits into from
Sep 23, 2024

Conversation

GreasySlug
Copy link
Member

{Path;} = pyimport "pathlib"
crr = Path()

print! crr # WindowsPath('.')

print! crr.resolve!() # WindowsPath('C:/Users/user/Desktop/erg')

for! crr.glob!("**/*.er"), pth =>
     print! pth
     
bump_version.er
crates\els\tests\a.er
...
tests\should_ok\many_import\unused_import.er

Changes proposed in this PR:

  • resolve!()
  • glob!()

@mtshiba

@mtshiba
Copy link
Member

mtshiba commented Sep 22, 2024

Since Path.glob! returns a generator, we should introduce a Generator T class (The type definition for iterdir is incorrect).

@GreasySlug
Copy link
Member Author

@mtshiba
Thanks for the review!!
Are there other issues that need to be added, such as the definition of Generator?

@mtshiba
Copy link
Member

mtshiba commented Sep 22, 2024

No, Generator is a compiler-builtin type.

@mtshiba mtshiba self-requested a review September 22, 2024 14:54
@GreasySlug GreasySlug merged commit 21caf6f into erg-lang:main Sep 23, 2024
21 checks passed
@mtshiba
Copy link
Member

mtshiba commented Sep 23, 2024

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants