Skip to content

Commit 6993ff6

Browse files
committed
Rename Submission language_id attribute to language. Add new dataclass for storing language id and name.
1 parent aa99dd2 commit 6993ff6

16 files changed

+84
-75
lines changed

examples/0001_hello_world.py

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

33
submission = judge0.Submission(
44
source_code="print('Hello Judge0')",
5-
language_id=100,
5+
language=100,
66
)
77

88
# Run submission on CE flavor of judge0.

examples/0002_hello_world.py

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

33
submission = judge0.Submission(
44
source_code="print('Hello Judge0')",
5-
language_id=25,
5+
language=25,
66
)
77

88
# Instead of relying on the CE flavor of judge0, we can use EXTRA_CE.

examples/0003_hello_world.py

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

33
submission = judge0.Submission(
44
source_code="print('Hello Judge0')",
5-
language_id=judge0.PYTHON,
5+
language=judge0.PYTHON,
66
)
77

88
judge0.run(submissions=submission)

examples/atd_submission.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def run_example(client_class, language_id):
1313
client = client_class(api_key=api_key)
1414
submission = judge0.Submission(
1515
source_code="print('Hello Judge0')",
16-
language_id=language_id,
16+
language=language_id,
1717
expected_output="Hello Judge0",
1818
)
1919

examples/atd_submissions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ def run_example(client_class, lang_id_python, lang_id_c):
1313
client = client_class(api_key=api_key)
1414
submission1 = judge0.Submission(
1515
source_code="print('Hello Judge0')",
16-
language_id=lang_id_python,
16+
language=lang_id_python,
1717
expected_output="Hello Judge0",
1818
)
1919
submission2 = judge0.Submission(
2020
source_code='#include <stdio.h>\n\nint main() {\n printf("Hello World!");\n return 0;\n}',
21-
language_id=lang_id_c,
21+
language=lang_id_c,
2222
expected_output="Hello World!",
2323
)
2424

examples/rapid_submission.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def run_example(client_class, language_id):
1313
client = client_class(api_key=api_key)
1414
submission = judge0.Submission(
1515
source_code="print('Hello Judge0')",
16-
language_id=language_id,
16+
language=language_id,
1717
expected_output="Hello Judge0",
1818
)
1919

examples/rapid_submissions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ def run_example(client_class, lang_id_python, lang_id_c):
1313
client = client_class(api_key=api_key)
1414
submission1 = judge0.Submission(
1515
source_code="print('Hello Judge0')",
16-
language_id=lang_id_python,
16+
language=lang_id_python,
1717
expected_output="Hello Judge0",
1818
)
1919
submission2 = judge0.Submission(
2020
source_code='#include <stdio.h>\n\nint main() {\n printf("Hello World!");\n return 0;\n}',
21-
language_id=lang_id_c,
21+
language=lang_id_c,
2222
expected_output="Hello World!",
2323
)
2424

examples/sulu_submission.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def run_example(client_class, language_id):
1313
client = client_class(api_key=api_key)
1414
submission = judge0.Submission(
1515
source_code="print('Hello Judge0')",
16-
language_id=language_id,
16+
language=language_id,
1717
expected_output="Hello Judge0",
1818
)
1919

examples/sulu_submissions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ def run_example(client_class, lang_id_python, lang_id_c):
1313
client = client_class(api_key=api_key)
1414
submission1 = judge0.Submission(
1515
source_code="print('Hello Judge0')",
16-
language_id=lang_id_python,
16+
language=lang_id_python,
1717
expected_output="Hello Judge0",
1818
)
1919
submission2 = judge0.Submission(
2020
source_code='#include <stdio.h>\n\nint main() {\n printf("Hello World!");\n return 0;\n}',
21-
language_id=lang_id_c,
21+
language=lang_id_c,
2222
expected_output="Hello World!",
2323
)
2424

src/judge0/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22

33
from .api import async_execute, execute, run, sync_execute, wait
4+
from .base_types import Flavor, Language, LanguageAlias, Status
45
from .clients import (
56
ATD,
67
ATDJudge0CE,
@@ -13,7 +14,6 @@
1314
SuluJudge0CE,
1415
SuluJudge0ExtraCE,
1516
)
16-
from .common import Flavor, LanguageAlias, Status
1717
from .retry import MaxRetries, MaxWaitTime, RegularPeriodRetry
1818
from .submission import Submission
1919

@@ -22,6 +22,7 @@
2222
"ATDJudge0CE",
2323
"ATDJudge0ExtraCE",
2424
"Client",
25+
"Language",
2526
"LanguageAlias",
2627
"MaxRetries",
2728
"MaxWaitTime",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy