전체 글

TaeGit

    [RustPython] traceback.tb_next mutable 하게 만들기

    Merged PR Update traceback.tb_next to be writable. Update `traceback.tb_next` to be writable. by tgsong827 · Pull Request #4087 · RustPython/RustPython Resolves #3857 github.com 개요 traceback은 tb_next라는 속성을 갖고 있다. tb_next 속성은 read 하는 것만 가능했고, 이를 writable 하게 만든 내용이다. 과정 분석 RustPython에서 tracback을 구현하는 Rust 구조체는 PyTraceback이다. PyTraceback은 tb_next 메소드를 갖고 있는데, 이는 tb_next 속성을 호출할 때 사용된다. tb_next 메소드를..

    [RustPython] sslError 클래스에 library, reason 속성 추가하기

    ISSUE ssl.SSLError.reason ssl.SSLError.reason · Issue #4000 · RustPython/RustPython Feature ssl.SSLError.reason Python Documentation https://docs.python.org/3/library/ssl.html#ssl.SSLError.reason github.com Merged PR Add 'library', 'reason' Attribute to ssl.SSLError Add 'library', 'reason' Attribute to ssl.SSLError by tgsong827 · Pull Request #4058 · RustPython/RustPython This PR associated with..

    반복문과 루프 레이블 - Rust 프로그래밍

    Rust 반복문 while while 반복문은 많은 언어들에서 사용하는 방식과 유사하다. while 반복문은 주어진 조건이 참이면 처리를 반복한다. let mut count = 0; while count < 10 { println!("{}", count); count += 1; } 많은 언어들에서 무한 반복문을 만들기 위해 while 문을 아래와 같이 활용한다. while true { println!("무한 반복"); } 러스트에서는 loop 키워드를 통해 더 간단히 해결할 수 있다. 위 코드를 빌드하면 아래와 같이 Rust 컴파일러가 친절하게 loop를 사용하라는 warning을 보여준다. loop loop 키워드는 다음에 오는 코드 블록을 무한히 반복하는데, break 키워드를 만나거나 프로그램이 종..

    [RustPython] Set타입 fn update 수정하기

    Merged PR Fix set test_merge_and_mutate Fix set test_merge_and_mutate by tgsong827 · Pull Request #3935 · RustPython/RustPython fix #3866 make function update_internal() check AnySet Type check Dict Type github.com 개요 set.update() 함수는 인자로 set 타입과 dict 타입도 받을 수 있는데, 이 경우 인자로 넘어온 set과 dict 타입이 담고 있는 객체가 무엇이냐에 따라 update 도중 Iteration의 사이즈가 변할 수 있습니다. CPython에서는 update의 인자로 들어온 iterable 객체가 set 타입인지 ..

    [RustPython] StopIteration 수정하기

    Merged PR Fix define_exception! of PyStopIteration to set value of value attribute Fix define_exception! of PyStopIteration to set value of value attribute by tgsong827 · Pull Request #3869 · RustPython/RustPy github.com 개요 CPython의 StopIteration 클래스 생성자는 하나의 Argument를 받습니다. 그리고 이 Argument는 value 속성에 할당됩니다. RustPython에서는 StopIteration의 value를 호출 했을 때 값이 정상적으로 나오지만, value의 값을 수정하려고 하면 에러가 발생하는 현상..