Giter Site home page Giter Site logo

Comments (1)

lumyjuwon avatar lumyjuwon commented on May 25, 2024 1

아무래도 변수 명에서 혼란이 오신 것 같습니다.
self.selected_category = key를 해줄 경우 args의 마지막 원소만 selected_category에 의해 할당될 것입니다.
예로 들어 args = ["IT과학", "생활문화", "경제"] 일 경우에
self.selected_category = key를 하게 될 경우

for key in args:
    self.selected_category = key

self.selected_category = 경제가 됩니다.

하지만 self.selected_category는 사용자가 args를 한 모든 값을 할당해야 합니다.
self.selected_category = ["IT과학", "생활문화", "경제"]

그리고 issue를 올려주셔서 저도 확인하게 된 것인데,

def set_category(self, *args):
    for key in args:
        if self.category.get(key) is None:  
            raise InvalidCategory(key)  
        else:  
            self.selected_category = args  

이것 보다는

def set_category(self, *args):
    for key in args:
        if self.categories.get(key) is None:
            raise InvalidCategory(key)
    self.selected_categories = args

이것이 맞다고 생각이 들어서 이와 관련해서 변수 명 및 로직 리팩토링을 해뒀습니다.

이슈 올려주셔서 감사드립니다.

from koreanewscrawler.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.