Skip to content

Instantly share code, notes, and snippets.

@jamesperes-zz
Created May 29, 2020 02:51
Show Gist options
  • Save jamesperes-zz/f4e42022f6a9749ac33f3d0969ee6fcf to your computer and use it in GitHub Desktop.
Save jamesperes-zz/f4e42022f6a9749ac33f3d0969ee6fcf to your computer and use it in GitHub Desktop.
from dataclasses import dataclass
@dataclass
class UserInfo():
"""Entity to establish User info."""
id: int = None
type: str = None
company_number: int = None
phone: int = None
name: str = None
def __bool__(self):
"""Validate if attributes are empties.
Returns:
False if id is empty. True if at least on is not
empty.
"""
return bool(self.id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment