File: struct_new.py

package info (click to toggle)
pysolfc 3.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 94,856 kB
  • sloc: python: 82,020; tcl: 4,529; makefile: 65; sh: 57; perl: 48
file content (25 lines) | stat: -rw-r--r-- 515 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2019 Shlomi Fish <shlomif@cpan.org>
#
# Distributed under terms of the MIT license.

"""

"""


class NewStruct(object):
    """docstring for NewStruct"""
    def copy(self):
        ret = self.__class__()
        ret.__dict__.update(self.__dict__)
        return ret

    def addattr(self, **kw):
        for k in kw.keys():
            if k in self.__dict__:
                raise AttributeError(k)
        self.__dict__.update(kw)